From 9fe0ad9bff6132b7231d5d987bb49f3ddc3bca56 Mon Sep 17 00:00:00 2001 From: Shih-Hao Li Date: Fri, 21 Oct 2016 11:51:13 -0700 Subject: [PATCH] NSXv3: Clean up pending entries when create_router failed A DBError exception could happen when updating router gateway during create_router. The plugin needs to clean up pending entries when it happens. Change-Id: I799c26e8a1a962ea78b17eb4e80e8d64bdf034a7 --- vmware_nsx/plugins/nsx_v3/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index 945fc46235..3c003775ba 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -2374,7 +2374,7 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin, if gw_info != const.ATTR_NOT_SPECIFIED: try: self._update_router_gw_info(context, router['id'], gw_info) - except nsx_lib_exc.ManagerError: + except (db_exc.DBError, nsx_lib_exc.ManagerError): with excutils.save_and_reraise_exception(): LOG.error(_LE("Failed to set gateway info for router " "being created: %s - removing router"),