]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Bad translation from network types to nvp transport types
authorSalvatore Orlando <sorlando@nicira.com>
Wed, 12 Dec 2012 12:22:50 +0000 (04:22 -0800)
committerSalvatore Orlando <salv.orlando@gmail.com>
Wed, 6 Feb 2013 22:47:07 +0000 (14:47 -0800)
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

quantum/plugins/nicira/nicira_nvp_plugin/QuantumPlugin.py

index 653bd15faf07343d944eef27ad2d72dcdef396a7..2eb4d277915450a2f2dd4b9ff5d267605d71d86d 100644 (file)
@@ -358,12 +358,14 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2,
                           "network %s"), net_data.get('name', '<unknown>'))
         tenant_id = self._get_tenant_id_for_create(context, net_data)
         target_cluster = self._find_target_cluster(net_data)
-        lswitch = nvplib.create_lswitch(target_cluster,
-                                        tenant_id,
-                                        net_data.get('name'),
-                                        net_data.get(pnet.NETWORK_TYPE),
-                                        net_data.get(pnet.PHYSICAL_NETWORK),
-                                        net_data.get(pnet.SEGMENTATION_ID))
+        nvp_binding_type = net_data.get(pnet.NETWORK_TYPE)
+        if nvp_binding_type in ('flat', 'vlan'):
+            nvp_binding_type = 'bridge'
+        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.SEGMENTATION_ID))
         network['network']['id'] = lswitch['uuid']
 
         with context.session.begin(subtransactions=True):