def AkamaiEdgeGridConfig_Setup(config_file, section):
config_file = os.path.expanduser(config_file)
if debug: print "DEBUG: config_file", config_file
#Currently unused.
required_options = ['client_token','client_secret','host','access_token']
EdgeGridConfig = {}
if os.path.isfile(config_file):
config = ConfigParser.ConfigParser()
config.readfp(open(config_file))
for key, value in config.items(section):
# ConfigParser lowercases magically
EdgeGridConfig[key] = value
else:
print "Missing configuration file. Run python gen_creds.py to get your credentials file set up once you've provisioned credentials in LUNA."
exit()
EdgeGridConfig['host'] = '%s://%s' % ('https', EdgeGridConfig['host'])
if debug: print EdgeGridConfig
return EdgeGridConfig
#Setup a EdgeGrid Session using the EdgeGridConfig previously loaded.
评论列表
文章目录