From 1b908162128dc05f8416c7425caf2a5a6ca8e505 Mon Sep 17 00:00:00 2001 From: asarfaty Date: Tue, 3 Mar 2020 09:57:06 +0200 Subject: [PATCH] NSX|P: Improve error handling for MP mdproxy port Change-Id: I6573274e43f6c59fcffd334d32bb30391cd7a65a --- vmware_nsx/plugins/nsx_p/plugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vmware_nsx/plugins/nsx_p/plugin.py b/vmware_nsx/plugins/nsx_p/plugin.py index c1d655de50..7a9a7c2cf7 100644 --- a/vmware_nsx/plugins/nsx_p/plugin.py +++ b/vmware_nsx/plugins/nsx_p/plugin.py @@ -794,10 +794,10 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base): self._create_net_mp_mdproxy_port( context, created_net, az, nsx_net_id) except Exception as e: - LOG.exception("Failed to create mdproxy port for network %s: " - "%s", net_id, e) - with excutils.save_and_reraise_exception(): - self.delete_network(context, net_id) + msg = ("Failed to complete network creation. error: %s" % e) + LOG.exception(msg) + self.delete_network(context, net_id) + raise nsx_exc.NsxPluginException(err_msg=msg) # Update the QoS policy (will affect only future compute ports) qos_com_utils.set_qos_policy_on_new_net(