From 8364a82f30552d5e4fef61835afe5feb1a142f00 Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Thu, 10 Oct 2019 09:24:58 +0300 Subject: [PATCH] NSX|P: Fail network creation of mdproxy creation fails Change-Id: I1c806c44697cb00093125dbb0c5b65ab0b13e9d7 --- vmware_nsx/plugins/nsx_p/plugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vmware_nsx/plugins/nsx_p/plugin.py b/vmware_nsx/plugins/nsx_p/plugin.py index 14fec36588..36a697154c 100644 --- a/vmware_nsx/plugins/nsx_p/plugin.py +++ b/vmware_nsx/plugins/nsx_p/plugin.py @@ -758,8 +758,10 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base): self._create_net_mdproxy_port( context, created_net, az, nsx_net_id) except Exception as e: - LOG.error("Failed to create mdproxy port for network %s: %s", - net_id, 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) # Update the QoS policy (will affect only future compute ports) qos_com_utils.set_qos_policy_on_new_net(