]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix KeyError for NVP plugin during portbinding update
authorarmando-migliaccio <amigliaccio@nicira.com>
Wed, 18 Sep 2013 19:41:01 +0000 (12:41 -0700)
committerarmando-migliaccio <amigliaccio@nicira.com>
Wed, 18 Sep 2013 19:41:24 +0000 (12:41 -0700)
Add missing unit test coverage, that unveiled the issue.

Closes-Bug: 1227247

Change-Id: I0d5a3b637d86308d82bf96bdb07928b19fd1b284

neutron/plugins/nicira/NeutronPlugin.py
neutron/tests/unit/nicira/test_nicira_plugin.py

index 52485635c6870e651596634df8c50828d0910aec..7b34de882ad2ed127943cbb60b30be293b65626a 100644 (file)
@@ -1163,7 +1163,8 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin,
                         "%(tenant_id)s: (%(id)s)"), port_data)
 
             self._process_portbindings_create_and_update(context,
-                                                         port, port_data)
+                                                         port['port'],
+                                                         port_data)
         # DB Operation is complete, perform NVP operation
         try:
             port_data = port['port'].copy()
@@ -1311,7 +1312,7 @@ class NvpPluginV2(addr_pair_db.AllowedAddressPairsMixin,
 
             self._process_portbindings_create_and_update(context,
                                                          port['port'],
-                                                         port)
+                                                         ret_port)
         return ret_port
 
     def delete_port(self, context, id, l3_port_check=True,
index be6c11fc1a3ff510b7cbe1c75439582518b00275..bfb14d49c05b8576304af789179f0e9f9b52c529 100644 (file)
@@ -165,7 +165,8 @@ class TestNiciraProvidernet(NiciraPluginV2TestCase):
 
 class TestNiciraPortsV2(NiciraPluginV2TestCase,
                         test_plugin.TestPortsV2,
-                        test_bindings.PortBindingsTestCase):
+                        test_bindings.PortBindingsTestCase,
+                        test_bindings.PortBindingsHostTestCaseMixin):
 
     VIF_TYPE = portbindings.VIF_TYPE_OVS
     HAS_PORT_FILTER = True