manage.py 文件源码

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

项目:kuberdock-platform 作者: cloudlinux 项目源码 文件源码
def run(self, subnet, exclude, include, node=None):
        if exclude and include:
            raise InvalidCommand('Can\'t specify both -e and -i')

        if include:
            to_include = ippool.IpAddrPool().parse_autoblock(include)
            net = IPv4Network(unicode(subnet))
            hosts = {str(i) for i in net.hosts()}
            # Do not include network and broadcast IP address
            # TODO: Fix according to AC-4044
            hosts.add(str(net.network_address))
            hosts.add(str(net.broadcast_address))

            exclude = ','.join(hosts - to_include)

        ippool.IpAddrPool().create({
            'network': subnet.decode(),
            'autoblock': exclude,
            'node': node
        })
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号