optimizeManifest.py 文件源码

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

项目:solace-messaging-cf-dev 作者: SolaceLabs 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号