subnets.py 文件源码

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

项目:quark 作者: openstack 项目源码 文件源码
def _pool_is_growing(original_pool, new_pool):
    # create IPSet for original pool
    ori_set = netaddr.IPSet()
    for rng in original_pool._alloc_pools:
        ori_set.add(netaddr.IPRange(rng['start'], rng['end']))

    # create IPSet for net pool
    new_set = netaddr.IPSet()
    for rng in new_pool._alloc_pools:
        new_set.add(netaddr.IPRange(rng['start'], rng['end']))

    # we are growing the original set is not a superset of the new set
    return not ori_set.issuperset(new_set)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号