Browse Source

NSX|V: Fix portgroup provider network validation

In case the physical network is not assigned, the db query
should be skipped or else it fails and raise.

Change-Id: Ief5af76f47e6b037e5fdda707f7fa75f73b0653f
changes/48/778248/1
asarfaty 2 months ago
committed by Adit Sarfaty
parent
commit
f1010b01ef
1 changed files with 9 additions and 8 deletions
  1. +9
    -8
      vmware_nsx/plugins/nsx_v/plugin.py

+ 9
- 8
vmware_nsx/plugins/nsx_v/plugin.py View File

@ -816,14 +816,15 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
physical_network, network['name'])):
err_msg = _("Portgroup name must match network name")
# make sure no other neutron network is using it
bindings = (
nsxv_db.get_network_bindings_by_physical_net_and_type(
context.elevated().session, physical_network,
network_type))
if bindings:
err_msg = (_('protgroup %s is already used by '
'another network') % physical_network)
if not err_msg:
# make sure no other neutron network is using it
bindings = (
nsxv_db.get_network_bindings_by_physical_net_and_type(
context.elevated().session, physical_network,
network_type))
if bindings:
err_msg = (_('protgroup %s is already used by '
'another network') % physical_network)
else:
err_msg = (_("%(net_type_param)s %(net_type_value)s not "
"supported") %


Loading…
Cancel
Save