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
This commit is contained in:
parent
dcc896fc66
commit
f1010b01ef
|
@ -816,14 +816,15 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
||||||
physical_network, network['name'])):
|
physical_network, network['name'])):
|
||||||
err_msg = _("Portgroup name must match network name")
|
err_msg = _("Portgroup name must match network name")
|
||||||
|
|
||||||
# make sure no other neutron network is using it
|
if not err_msg:
|
||||||
bindings = (
|
# make sure no other neutron network is using it
|
||||||
nsxv_db.get_network_bindings_by_physical_net_and_type(
|
bindings = (
|
||||||
context.elevated().session, physical_network,
|
nsxv_db.get_network_bindings_by_physical_net_and_type(
|
||||||
network_type))
|
context.elevated().session, physical_network,
|
||||||
if bindings:
|
network_type))
|
||||||
err_msg = (_('protgroup %s is already used by '
|
if bindings:
|
||||||
'another network') % physical_network)
|
err_msg = (_('protgroup %s is already used by '
|
||||||
|
'another network') % physical_network)
|
||||||
else:
|
else:
|
||||||
err_msg = (_("%(net_type_param)s %(net_type_value)s not "
|
err_msg = (_("%(net_type_param)s %(net_type_value)s not "
|
||||||
"supported") %
|
"supported") %
|
||||||
|
|
Loading…
Reference in New Issue