Bad translation from network types to nvp transport types

Bug 1117769

'Flat' and 'Vlan' where not being converted into 'bridge'
This change cannot have unit tests because the fake nvp api
client does not validate such constraints at the moment

Change-Id: I2b918265cb8becf6f023abc7937b92b3058d9446
This commit is contained in:
Salvatore Orlando 2012-12-12 04:22:50 -08:00 committed by Salvatore Orlando
parent f03ea764dc
commit af33f1d051

View File

@ -358,10 +358,12 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2,
"network %s"), net_data.get('name', '<unknown>')) "network %s"), net_data.get('name', '<unknown>'))
tenant_id = self._get_tenant_id_for_create(context, net_data) tenant_id = self._get_tenant_id_for_create(context, net_data)
target_cluster = self._find_target_cluster(net_data) target_cluster = self._find_target_cluster(net_data)
lswitch = nvplib.create_lswitch(target_cluster, nvp_binding_type = net_data.get(pnet.NETWORK_TYPE)
tenant_id, if nvp_binding_type in ('flat', 'vlan'):
net_data.get('name'), nvp_binding_type = 'bridge'
net_data.get(pnet.NETWORK_TYPE), lswitch = nvplib.create_lswitch(
target_cluster, tenant_id, net_data.get('name'),
nvp_binding_type,
net_data.get(pnet.PHYSICAL_NETWORK), net_data.get(pnet.PHYSICAL_NETWORK),
net_data.get(pnet.SEGMENTATION_ID)) net_data.get(pnet.SEGMENTATION_ID))
network['network']['id'] = lswitch['uuid'] network['network']['id'] = lswitch['uuid']