validate.py 文件源码

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

项目:DeepSea 作者: SUSE 项目源码 文件源码
def public_network(self):
        """
        All nodes must have the same public network.  The public network
        must be valid.
        """
        for node in self.data.keys():
            public_network = self.data[node].get("public_network", "")
            net_list = Util.parse_list_from_string(public_network)

            log.debug("public_network: {} {}".format(node, net_list))
            for network in net_list:
                try:
                    ipaddress.ip_network(u'{}'.format(network))
                except ValueError as err:
                    msg = "{} on {} is not valid: {}".format(network, node, err)
                    self.errors.setdefault('public_network', []).append(msg)

        self._set_pass_status('public_network')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号