nvp:log only in rm router iface if port not found

The code currently raises when it's not able to find the port to be
deleted on the backend. This might happen, for instance, when the
port is manually removed or, in some cases, if port creation failed
in the first place.

There's little sense in raising when a resource to be removed is not
found; therefore this patch replaces the raise statement with a log
statement.

Bug 1240720

Change-Id: Ifa756b07ef41346a44325341c8e0e8994dc64dde
This commit is contained in:
Salvatore Orlando 2013-10-16 15:11:34 -07:00
parent 91f67bf80f
commit eef8fef405

View File

@ -520,8 +520,12 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin,
nvp_port_id = self._nvp_get_port_id(context, self.cluster, nvp_port_id = self._nvp_get_port_id(context, self.cluster,
port_data) port_data)
if not nvp_port_id: if not nvp_port_id:
raise q_exc.PortNotFound(port_id=port_data['id']) LOG.warn(_("Neutron port %(port_id)s not found on NVP backend. "
"Terminating delete operation. A dangling router port "
"might have been left on router %(router_id)s"),
{'port_id': port_data['id'],
'router_id': lrouter_id})
return
try: try:
nvplib.delete_peer_router_lport(self.cluster, nvplib.delete_peer_router_lport(self.cluster,
lrouter_id, lrouter_id,