From d43f060b19b7587eae5f0f95ce5988233143a1eb Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Wed, 24 Aug 2016 05:36:39 -0700 Subject: [PATCH] NSX|V3: Enhance add router interface failure handle Whatever exception we got when adding router interface, we would try to rollback including removing router interface in case of second add-router-interface try failed. Co-Authored-By: linb Change-Id: Icd434cb0be5d4150ab381d38916df02084a94f58 --- vmware_nsx/plugins/nsx_v3/plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index 9188c4c64c..f6381e0d60 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -2477,8 +2477,11 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, # its DHCP port), by creating it if needed. nsx_rpc.handle_router_metadata_access(self, context, router_id, interface=info) - except nsx_lib_exc.ManagerError: + except Exception: with excutils.save_and_reraise_exception(): + LOG.error(_LE("Neutron failed to add_router_interface on " + "router %s, and would try to rollback."), + router_id) self.remove_router_interface( context, router_id, interface_info) return info