def get_dir(args):
config = ConfigParser.RawConfigParser()
dirs = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
with open(dirs+'/adminset.conf', 'r') as cfgfile:
config.readfp(cfgfile)
a_path = config.get('config', 'ansible_path')
r_path = config.get('config', 'roles_path')
p_path = config.get('config', 'playbook_path')
s_path = config.get('config', 'scripts_path')
token = config.get('token', 'token')
ssh_pwd = config.get('token', 'ssh_pwd')
log_path = config.get('log', 'log_path')
log_level = config.get('log', 'log_level')
mongodb_ip = config.get('mongodb', 'mongodb_ip')
mongodb_port = config.get('mongodb', 'mongodb_port')
mongodb_user = config.get('mongodb', 'mongodb_user')
mongodb_pwd = config.get('mongodb', 'mongodb_pwd')
mongodb_collection = config.get('mongodb', 'collection')
webssh_domain = config.get('webssh', 'domain')
# ???????????????????????????
if args:
return vars()[args]
else:
return HttpResponse(status=403)
评论列表
文章目录