rcommon.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:rtools 作者: malokch 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号