From: Kevin Benton Date: Tue, 8 Apr 2014 05:30:09 +0000 (-0700) Subject: BSN: Remove module-level ref to httplib method X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=77a58ecd0a65b688d9645a3c11a6dfb87e180449;p=openstack-build%2Fneutron-build.git BSN: Remove module-level ref to httplib method 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 --- diff --git a/neutron/plugins/bigswitch/servermanager.py b/neutron/plugins/bigswitch/servermanager.py index 447c9fc6b..8792290af 100644 --- a/neutron/plugins/bigswitch/servermanager.py +++ b/neutron/plugins/bigswitch/servermanager.py @@ -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 ' diff --git a/neutron/tests/unit/bigswitch/test_base.py b/neutron/tests/unit/bigswitch/test_base.py index 121a3d0ea..c927c4277 100644 --- a/neutron/tests/unit/bigswitch/test_base.py +++ b/neutron/tests/unit/bigswitch/test_base.py @@ -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' diff --git a/neutron/tests/unit/bigswitch/test_capabilities.py b/neutron/tests/unit/bigswitch/test_capabilities.py index 5dc1f29de..630430314 100644 --- a/neutron/tests/unit/bigswitch/test_capabilities.py +++ b/neutron/tests/unit/bigswitch/test_capabilities.py @@ -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): diff --git a/neutron/tests/unit/bigswitch/test_restproxy_plugin.py b/neutron/tests/unit/bigswitch/test_restproxy_plugin.py index 405498ab0..9e0f0bee3 100644 --- a/neutron/tests/unit/bigswitch/test_restproxy_plugin.py +++ b/neutron/tests/unit/bigswitch/test_restproxy_plugin.py @@ -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, diff --git a/neutron/tests/unit/bigswitch/test_router_db.py b/neutron/tests/unit/bigswitch/test_router_db.py index e5b24262e..0a7fa69b2 100644 --- a/neutron/tests/unit/bigswitch/test_router_db.py +++ b/neutron/tests/unit/bigswitch/test_router_db.py @@ -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 diff --git a/neutron/tests/unit/bigswitch/test_servermanager.py b/neutron/tests/unit/bigswitch/test_servermanager.py index d2dfd0f05..aae095b7b 100644 --- a/neutron/tests/unit/bigswitch/test_servermanager.py +++ b/neutron/tests/unit/bigswitch/test_servermanager.py @@ -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'