create.py 文件源码

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

项目:serveradmin 作者: innogames 项目源码 文件源码
def _get_host_ip_addr(attributes, networks):
    if 'intern_ip' not in attributes:
        if not networks:
            raise CreateError(
                '"intern_ip" is not given, and no networks could be found.'
            )
        intern_ip = _choose_ip_addr(networks)
        if intern_ip is None:
            raise CreateError(
                'No IP address could be selected from the given networks.'
            )
        return intern_ip

    try:
        intern_ip = ip_interface(attributes['intern_ip'])
    except ValueError as error:
        raise CreateError(str(error))

    _check_in_networks(networks, intern_ip.network)
    return intern_ip.ip
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号