From 341727eaef6e84b275a801b8ad397d6a72ad0278 Mon Sep 17 00:00:00 2001 From: Bob Melander Date: Tue, 17 Sep 2013 19:55:46 +0200 Subject: [PATCH] Make router-interface-delete work in N1kv plugin Fixes bug 1226729 Change-Id: If2c6bc544dfa45cb98d5951c99f158d49191b031 --- neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py b/neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py index 3725dec08..896ce0ffe 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) -- 2.45.2