def getTestNetworkIps(manifest):
testSubnets = getTestSubnets(manifest)
testSubnet = testSubnets[0]
otherSubnets = testSubnets[1:]
testIpSubnet = ipaddress.ip_network(testSubnet["range"])
otherIpSubnets = [ipaddress.ip_network(s["range"]) for s in otherSubnets]
subnetGateway = testSubnet["gateway"]
overlapOtherIpSubnets = [s for s in otherIpSubnets if testIpSubnet.overlaps(s)]
for otherIpSubnet in overlapOtherIpSubnets:
testIpSubnet = testIpSubnet.address_exclude(otherIpSubnet)
testHosts = [h.exploded for h in testIpSubnet.hosts()]
testHosts.remove(subnetGateway)
return testHosts
optimizeManifest.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录