def getConfig(cfgname):
cfg = globals()[cfgname]
# Scan the ip of configuration
if cfg:
if cfg['host'].startswith('-cmd-'):
cmd = cfg['host'][5:]
cfg['host'] = commands.getoutput(cmd)
elif cfg['host'].startswith('-func-'):
func_name = cfg['host'][6:]
func = globals()[func_name]
cfg['host'] = func()
print('IP[%s]: %s' % (cfgname,cfg['host']))
return cfg
评论列表
文章目录