center_control.py 文件源码

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

项目:pyflume 作者: jiangruocheng 项目源码 文件源码
def config():
    show()
    choose = raw_input('???????ip????????all:')
    try:
        if 'all' == choose:
            ip_list = SLAVE_LIST
        else:
            ip_list = [SLAVE_LIST[int(i)] for i in choose.split()]
        readline.set_completer(path_completer)
        _path = raw_input('??????????:')
        for ip in ip_list:
            print 'IP: ', ip, 'is proccessing...'
            address = "http://{}:12001/".format(ip)
            proxy = xmlrpclib.ServerProxy(address)
            with open(_path, 'r') as f:
                print 'Result:', str(proxy.config(f.read()))
            proxy('close')
    except:
        print traceback.format_exc()
    print 'Done.'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号