From 684bbdd956d19174a9a1c8b7219b90aff3fea767 Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Wed, 24 Oct 2018 11:45:59 +0300 Subject: [PATCH] NSX|V3: Do not fail on router rollback When rotuer interface creation fails, the plugin rolls it back. If the rollback also fails it should only log it, and keep the original exceprion of hte creation failure Change-Id: Ic2bc51ed7172ddb71b274164a16fda2218ed6d8a --- vmware_nsx/plugins/nsx_v3/plugin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index e79e80ee18..4a66ba1fdf 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -4392,8 +4392,13 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, LOG.error("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) + try: + self.remove_router_interface( + context, router_id, interface_info) + except Exception: + # rollback also failed + LOG.error("Neutron rollback failed to remove router " + "interface on router %s.", router_id) return info def remove_router_interface(self, context, router_id, interface_info):