diff --git a/neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py b/neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py index 3725dec082..896ce0ffe6 100644 --- a/neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py +++ b/neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py @@ -1283,7 +1283,7 @@ class N1kvNeutronPluginV2(db_base_plugin_v2.NeutronDbPluginV2, self._extend_port_dict_profile(context, port) return port - def delete_port(self, context, id): + def delete_port(self, context, id, l3_port_check=True): """ Delete a port. @@ -1291,6 +1291,11 @@ class N1kvNeutronPluginV2(db_base_plugin_v2.NeutronDbPluginV2, :param id: UUID representing the port to delete :returns: deleted port object """ + # if needed, check to see if this is a port owned by + # and l3-router. If so, we should prevent deletion. + if l3_port_check: + self.prevent_l3_port_deletion(context, id) + self.disassociate_floatingips(context, id) self._send_delete_port_request(context, id) return super(N1kvNeutronPluginV2, self).delete_port(context, id)