def LoadConfig()

in sample_common.py [0:0]


    def LoadConfig():
        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 inforamtion.\n")
                sys.exit(1)

        accessKeyId = os.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID")
        accessKeySecret = os.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET")
        securityToken = os.getenv("ALIBABA_CLOUD_ACCESS_SECURITY_TOKEN") or ""
        endpoint = parser.get("Base", "Endpoint")

        return accessKeyId, accessKeySecret, endpoint, securityToken