vpnporxy 部署纪要

解决fabfile中hosts变量的获取问题test_depoly中使用_find_hosts_by_cluster_and_container(cluster,container)来获取hosts,但是传进来的这两个变量都有可能是列表,所以要解决列表问题,最后还要解决hosts列表中的元素为列表的情况 1234567891011121314151617181920if type(containers) == str: hosts = map(lambda cluster: _find_hosts_by_cluster_and_container(cluster, containers), clusters)if type(containers) == list: hosts = [] for containers in containerss: host = map(lambda cluster: _find_hosts_by_cluster_and_container(cluster, container), clusters) hosts.extend(host)lst = []for host in hosts: if type(host) == list: lst.extend(host) else: lst.append(host)hosts = lstprint hostsif len(hosts) == 0: env.hosts = Noneelse: env.hosts = hosts

Docker
1…456

站内搜索

没有找到内容!