]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix URL used in NCS mechanism driver sync_full() operation
authorLuke Gorrie <luke@snabb.co>
Fri, 13 Sep 2013 14:30:28 +0000 (14:30 +0000)
committerLuke Gorrie <luke@snabb.co>
Wed, 18 Sep 2013 07:00:24 +0000 (07:00 +0000)
The URL was incorrect due to a simple argument-passing bug.

Change-Id: I2fabacdb2838022a1d187ceb70cb090c15457b7c
Closes-Bug: #1224981

neutron/plugins/ml2/drivers/mechanism_ncs.py
neutron/tests/unit/ml2/test_mechanism_ncs.py

index fc65447fa76f33a1c65ea371776ecc76e065cefa..833447731cb4c5ab4c4b02f8d59a6e54a8ace7bf 100644 (file)
@@ -116,7 +116,7 @@ class NCSMechanismDriver(api.MechanismDriver):
         json = {'openstack': {'network': networks,
                               'subnet': subnets,
                               'port': ports}}
-        self.sendjson('put', self.url, json)
+        self.sendjson('put', '', json)
         self.out_of_sync = False
 
     def sync_object(self, operation, object_type, context):
index 9c2eb5fe94e62530ea29c94848d118ea0088bdc1..2e1c23551bbc8fdbbb88c62e94f6bbd9419ccbe9 100644 (file)
@@ -14,6 +14,7 @@
 #    under the License.
 
 from neutron.plugins.ml2 import config as config
+from neutron.plugins.ml2.drivers import mechanism_ncs
 from neutron.tests.unit import test_db_plugin as test_plugin
 
 PLUGIN_NAME = 'neutron.plugins.ml2.plugin.Ml2Plugin'
@@ -31,6 +32,11 @@ class NCSTestCase(test_plugin.NeutronDbPluginV2TestCase):
         self.addCleanup(config.cfg.CONF.reset)
         super(NCSTestCase, self).setUp(PLUGIN_NAME)
         self.port_create_status = 'DOWN'
+        mechanism_ncs.NCSMechanismDriver.sendjson = self.check_sendjson
+
+    def check_sendjson(self, method, urlpath, obj):
+        # Confirm fix for bug #1224981
+        self.assertFalse(urlpath.startswith("http://"))
 
 
 class NCSMechanismTestBasicGet(test_plugin.TestBasicGet, NCSTestCase):