NSX|V3: support 'local' type for external network

Commit a97627ac513c1775c656fdb4b6acdec8b4de2f05 caused a
degradation with external network creation. Prior to this
patch a external network could be created in horizon with
type 'local.

That support needs to be continued for backwards compatibility.

Change-Id: Id0e891842c1d4e63c522a82b09beeeeca6fdbb7b
This commit is contained in:
Gary Kotton 2018-05-01 23:17:18 -07:00
parent fa628e3f71
commit 9c52c029d5
2 changed files with 3 additions and 1 deletions

View File

@ -51,6 +51,7 @@ class NetworkTypes(object):
VLAN = 'vlan'
BRIDGE = 'bridge'
PORTGROUP = 'portgroup'
LOCAL = 'local'
# Allowed network types for the NSX-v Plugin

View File

@ -954,7 +954,8 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
else:
tier0_uuid = net_data[pnet.PHYSICAL_NETWORK]
if ((validators.is_attr_set(net_data.get(pnet.NETWORK_TYPE)) and
net_data.get(pnet.NETWORK_TYPE) != utils.NetworkTypes.L3_EXT) or
net_data.get(pnet.NETWORK_TYPE) != utils.NetworkTypes.L3_EXT and
net_data.get(pnet.NETWORK_TYPE) != utils.NetworkTypes.LOCAL) or
validators.is_attr_set(net_data.get(pnet.SEGMENTATION_ID))):
msg = _("Invalid provider network configuration")
raise n_exc.InvalidInput(error_message=msg)