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
This commit is contained in:
Kevin Benton 2014-04-07 22:30:09 -07:00
parent f6515fb40d
commit 3a994e1d9f
6 changed files with 6 additions and 9 deletions

View 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 '

View 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'

View 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):

View 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,

View 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

View 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'