cldcnct.py 文件源码

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

项目:multi-cloud-control 作者: robertpeteuil 项目源码 文件源码
def get_conns(cred, providers):
    """Collect node data asynchronously using gevent lib."""
    cld_svc_map = {"aws": conn_aws,
                   "azure": conn_az,
                   "gcp": conn_gcp}
    sys.stdout.write("\rEstablishing Connections:  ")
    sys.stdout.flush()
    busy_obj = busy_disp_on()
    conn_fn = [[cld_svc_map[x.rstrip('1234567890')], cred[x], x]
               for x in providers]
    cgroup = Group()
    conn_res = []
    conn_res = cgroup.map(get_conn, conn_fn)
    cgroup.join()
    conn_objs = {}
    for item in conn_res:
        conn_objs.update(item)
    busy_disp_off(dobj=busy_obj)
    sys.stdout.write("\r                                                 \r")
    sys.stdout.write("\033[?25h")  # cursor back on
    sys.stdout.flush()
    return conn_objs
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号