Browse Source

NSX|P: Issue proper error in external network creation

Change-Id: If9633b4e74d8a354ff93d2a75968d41cee0f8ad3
tags/14.0.1
asarfaty 1 month ago
committed by Adit Sarfaty
parent
commit
7e2b4f4996
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      vmware_nsx/plugins/nsx_p/plugin.py

+ 6
- 1
vmware_nsx/plugins/nsx_p/plugin.py View File

@@ -657,7 +657,12 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):

def _tier0_validator(self, tier0_uuid):
# Fail if the tier0 uuid was not found on the NSX
self.nsxpolicy.tier0.get(tier0_uuid)
try:
self.nsxpolicy.tier0.get(tier0_uuid)
except Exception:
msg = (_("Cannot create external network as Tier0 %s was not "
"found") % tier0_uuid)
raise n_exc.InvalidInput(error_message=msg)

def _get_nsx_net_tz_id(self, nsx_net):
return nsx_net['transport_zone_path'].split('/')[-1]


Loading…
Cancel
Save