test_rpc_get_lwaftr_state.py 文件源码

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

项目:vmx-docker-lwaftr 作者: Juniper 项目源码 文件源码
def main(argv):
    """
    Used to fetch the snabb instance information from the JET app.

    :param argv: Arguments for the command
    :return: Dictionary of instances state information
    """
    try:
        server = xmlrpclib.ServerProxy('http://127.0.0.1:9191', verbose=False)
    output = server.lwaftr()
    except Exception as e:
        output = "Failed to connect to jetapp " + e.message+ " user: "+ str(os.geteuid()) 
    print "<snabb><instance><rpc_error>"+output+"</rpc_error></instance></snabb>"
        return
    if (output != None):
        snabb_state(output)
    else:
    print "<snabb><instance><rpc_error>"+output+"</rpc_error></instance></snabb>"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号