]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
DeferredBridge to allow add_tunnel_port passthru
authorVivekanandan Narasimhan <vivekanandan.narasimhan@hp.com>
Thu, 7 Aug 2014 10:58:49 +0000 (03:58 -0700)
committerarmando-migliaccio <armamig@gmail.com>
Thu, 7 Aug 2014 15:53:43 +0000 (08:53 -0700)
The DeferredBridge should allow add_tunnel_port
method as passthrough in addition to add_port
and delete_port. L2Pop uses add_tunnel_port to
dynamically establish tunnel endpoints on cloud
nodes.

Closes-Bug: #1353885

Change-Id: I2e6d82ee79814e500604f4951e7d89eab662047a

neutron/agent/linux/ovs_lib.py
neutron/tests/unit/agent/linux/test_ovs_lib.py

index 90be0c3b52aa87883e501e70e2672ca3c916f4db..a99a013ec364c06d1fa730227ed88c50073b2845 100644 (file)
@@ -462,7 +462,7 @@ class DeferredOVSBridge(object):
     This class is not thread-safe, that's why for every use a new instance
     must be implemented.
     '''
-    ALLOWED_PASSTHROUGHS = 'add_port', 'delete_port'
+    ALLOWED_PASSTHROUGHS = 'add_port', 'add_tunnel_port', 'delete_port'
 
     def __init__(self, br, full_ordered=False,
                  order=('add', 'mod', 'del')):
index 6742a3b3bf9cdece3c7d0444480d98bc26c25c1a..04afdaf193b1b13026a521054781a5c31d269438 100644 (file)
@@ -880,6 +880,11 @@ class TestDeferredOVSBridge(base.BaseTestCase):
         self.del_flow_dict1 = dict(in_port=31)
         self.del_flow_dict2 = dict(in_port=32)
 
+    def test_right_allowed_passthroughs(self):
+        expected_passthroughs = ('add_port', 'add_tunnel_port', 'delete_port')
+        self.assertEqual(expected_passthroughs,
+                         ovs_lib.DeferredOVSBridge.ALLOWED_PASSTHROUGHS)
+
     def _verify_mock_call(self, expected_calls):
         self.mocked_do_action_flows.assert_has_calls(expected_calls)
         self.assertEqual(len(expected_calls),