From f654df7e377bf17fad26470e22dd72e7628257a4 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 358d1ffe46..7cd31d8e28 100644 --- a/vmware_nsx/plugins/nsx_p/plugin.py +++ b/vmware_nsx/plugins/nsx_p/plugin.py @@ -762,8 +762,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(