network = self._get_by_id(context, models_v2.Network, id)
except exc.NoResultFound:
raise q_exc.NetworkNotFound(net_id=id)
- except exc.MultipleResultsFound:
- LOG.error(_('Multiple networks match for %s'), id)
- raise q_exc.NetworkNotFound(net_id=id)
return network
def _get_subnet(self, context, id):
subnet = self._get_by_id(context, models_v2.Subnet, id)
except exc.NoResultFound:
raise q_exc.SubnetNotFound(subnet_id=id)
- except exc.MultipleResultsFound:
- LOG.error(_('Multiple subnets match for %s'), id)
- raise q_exc.SubnetNotFound(subnet_id=id)
return subnet
def _get_port(self, context, id):
# NOTE(jkoelker) The PortNotFound exceptions requires net_id
# kwarg in order to set the message correctly
raise q_exc.PortNotFound(port_id=id, net_id=None)
- except exc.MultipleResultsFound:
- LOG.error(_('Multiple ports match for %s'), id)
- raise q_exc.PortNotFound(port_id=id)
return port
def _get_dns_by_subnet(self, context, subnet_id):
router = self._get_by_id(context, Router, id)
except exc.NoResultFound:
raise l3.RouterNotFound(router_id=id)
- except exc.MultipleResultsFound:
- LOG.error(_('Multiple routers match for %s'), id)
- raise l3.RouterNotFound(router_id=id)
return router
def _make_router_dict(self, router, fields=None,
floatingip = self._get_by_id(context, FloatingIP, id)
except exc.NoResultFound:
raise l3.FloatingIPNotFound(floatingip_id=id)
- except exc.MultipleResultsFound:
- LOG.error(_('Multiple floating ips match for %s'), id)
- raise l3.FloatingIPNotFound(floatingip_id=id)
return floatingip
def _make_floatingip_dict(self, floatingip, fields=None):
packet_filter = self._get_by_id(context, nmodels.PacketFilter, id)
except exc.NoResultFound:
raise q_exc.PacketFilterNotFound(id=id)
- except exc.MultipleResultsFound:
- LOG.error(_('Multiple packet_filters match for %s'), id)
- raise q_exc.PacketFilterNotFound(id=id)
return packet_filter
def get_packet_filter(self, context, id, fields=None):