neutron.py 文件源码

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

项目:zun 作者: openstack 项目源码 文件源码
def get_neutron_port(self, port):
        if uuidutils.is_uuid_like(port):
            ports = self.list_ports(id=port)['ports']
        else:
            ports = self.list_ports(name=port)['ports']

        if len(ports) == 0:
            raise exception.PortNotFound(port=port)
        elif len(ports) > 1:
            raise exception.Conflict(_(
                'Multiple neutron ports exist with same name. '
                'Please use the uuid instead.'))

        port = ports[0]
        return port
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号