]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
BSN: Remove module-level ref to httplib method
authorKevin Benton <blak111@gmail.com>
Tue, 8 Apr 2014 05:30:09 +0000 (22:30 -0700)
committerKevin Benton <blak111@gmail.com>
Tue, 8 Apr 2014 05:37:46 +0000 (22:37 -0700)
Removes a module-level variable that was just a
pointer to the httplib.HTTPConnection class. It's
purpose was to give mock.patch a target that wouldn't
affect other code using the httplib.HTTPConnection
library. However, it is unnecessary now that the
root cause of the original patches not being stopped
by mock.patch.stopall was fixed in bug 1303605 (change
Ia5b374c5f8d3a7905d915de4f1f8d4f3a6f0e58d).

Closes-Bug: #1304558
Change-Id: Idf814b075a80245bb9751466c2b58d719a1b81f3

neutron/plugins/bigswitch/servermanager.py
neutron/tests/unit/bigswitch/test_base.py
neutron/tests/unit/bigswitch/test_capabilities.py
neutron/tests/unit/bigswitch/test_restproxy_plugin.py
neutron/tests/unit/bigswitch/test_router_db.py
neutron/tests/unit/bigswitch/test_servermanager.py

index 447c9fc6b54f02d3ae9f6a068aad0f21e9906e5b..8792290af6cf8582184f805031a8fe634e6cfe63 100644 (file)
@@ -71,9 +71,6 @@ ORCHESTRATION_SERVICE_ID = 'Neutron v2.0'
 HASH_MATCH_HEADER = 'X-BSN-BVS-HASH-MATCH'
 # error messages
 NXNETWORK = 'NXVNS'
-# NOTE(kevinbenton): This following is to give mock a target that doesn't
-# affect other users of httplib.HTTPConnection
-HTTPConnection = httplib.HTTPConnection
 
 
 class RemoteRestError(exceptions.NeutronException):
@@ -171,7 +168,7 @@ class ServerProxy(object):
                     return 0, None, None, None
                 self.currentconn.combined_cert = self.combined_cert
             else:
-                self.currentconn = HTTPConnection(
+                self.currentconn = httplib.HTTPConnection(
                     self.server, self.port, timeout=timeout)
                 if self.currentconn is None:
                     LOG.error(_('ServerProxy: Could not establish HTTP '
index 121a3d0ea075331b7f89d8f93358a68bd70e12b9..c927c4277939ff0b0f63f61e5ace58f61623755f 100644 (file)
@@ -30,7 +30,7 @@ NOTIFIER = 'neutron.plugins.bigswitch.plugin.AgentNotifierApi'
 CALLBACKS = 'neutron.plugins.bigswitch.plugin.RestProxyCallbacks'
 CERTFETCH = 'neutron.plugins.bigswitch.servermanager.ServerPool._fetch_cert'
 SERVER_MANAGER = 'neutron.plugins.bigswitch.servermanager'
-HTTPCON = 'neutron.plugins.bigswitch.servermanager.HTTPConnection'
+HTTPCON = 'neutron.plugins.bigswitch.servermanager.httplib.HTTPConnection'
 SPAWN = 'neutron.plugins.bigswitch.plugin.eventlet.GreenPool.spawn_n'
 CWATCH = SERVER_MANAGER + '.ServerPool._consistency_watchdog'
 
index 5dc1f29de97c59a5dc52c960e7a14b4bb9801096..6304303143c862ffa70edc6919d790bcce777cbb 100644 (file)
@@ -26,7 +26,7 @@ PLUGIN = 'neutron.plugins.bigswitch.plugin'
 SERVERMANAGER = PLUGIN + '.servermanager'
 SERVERPOOL = SERVERMANAGER + '.ServerPool'
 SERVERRESTCALL = SERVERMANAGER + '.ServerProxy.rest_call'
-HTTPCON = SERVERMANAGER + '.HTTPConnection'
+HTTPCON = SERVERMANAGER + '.httplib.HTTPConnection'
 
 
 class CapabilitiesTests(test_router_db.RouterDBTestBase):
index 405498ab07bf31b3205f70bac334cb9b88669009..9e0f0bee3f060f3a09e8d88be699e0856dc54d78 100644 (file)
@@ -31,7 +31,7 @@ import neutron.tests.unit.test_db_plugin as test_plugin
 import neutron.tests.unit.test_extension_allowedaddresspairs as test_addr_pair
 
 patch = mock.patch
-HTTPCON = 'neutron.plugins.bigswitch.servermanager.HTTPConnection'
+HTTPCON = 'neutron.plugins.bigswitch.servermanager.httplib.HTTPConnection'
 
 
 class BigSwitchProxyPluginV2TestCase(test_base.BigSwitchTestBase,
index e5b24262eceb385b4fb97199d701dbb8323007f8..0a7fa69b2de08b03e37c5894d4e658a3075a67fa 100644 (file)
@@ -39,7 +39,7 @@ from neutron.tests.unit import test_extension_extradhcpopts as test_extradhcp
 from neutron.tests.unit import test_l3_plugin
 
 
-HTTPCON = 'neutron.plugins.bigswitch.servermanager.HTTPConnection'
+HTTPCON = 'neutron.plugins.bigswitch.servermanager.httplib.HTTPConnection'
 _uuid = uuidutils.generate_uuid
 
 
index d2dfd0f05edc2f43f87c02c785e47d5a16d592ec..aae095b7b09d483409fabf92c3c376ab97bb59fd 100644 (file)
@@ -28,7 +28,7 @@ from neutron.plugins.bigswitch import servermanager
 from neutron.tests.unit.bigswitch import test_restproxy_plugin as test_rp
 
 SERVERMANAGER = 'neutron.plugins.bigswitch.servermanager'
-HTTPCON = SERVERMANAGER + '.HTTPConnection'
+HTTPCON = SERVERMANAGER + '.httplib.HTTPConnection'
 HTTPSCON = SERVERMANAGER + '.HTTPSConnectionWithValidation'