in sample_config.py [0:0]
def load_config():
cfg_fn = os.path.join(os.path.dirname(os.path.abspath(__file__)) + "/sample.cfg")
required_ops = [("Base", "Endpoint")]
parser = ConfigParser.ConfigParser()
parser.read(cfg_fn)
for sec, op in required_ops:
if not parser.has_option(sec, op):
sys.stderr.write("ERROR: need (%s, %s) in %s.\n" % (sec, op, cfg_fn))
sys.stderr.write("Read README to get help information.\n")
sys.exit(1)
access_key_id = os.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID")
access_key_secret = os.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET")
security_token = os.getenv("ALIBABA_CLOUD_ACCESS_SECURITY_TOKEN") or ""
endpoint = parser.get("Base", "Endpoint")
return access_key_id, access_key_secret, endpoint, security_token