From e0efd7551d0d4e1c23111419f0622a1994601fda Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Tue, 7 Feb 2012 22:31:27 -0500 Subject: Move connection pool back into impl_kombu/qpid. Fix bug 928996. This patch moves the creation of the connection pool from nova.rpc.amqp back into nova.rpc.impl_kombu and nova.rpc.impl_qpid. The pool now gets passed into nova.rpc.amqp using arguments as needed. The previous method worked fine unless both rpc implementations got loaded into the same Python instance. In that case, whichever one got loaded 2nd had control over what type of connections nova.rpc.amqp would create. With these changes in place, this conflict between impl_kombu and impl_qpid is resolved. Change-Id: I72bc0c95bfc04ccdfb89d3456332f622ca5ffa42 --- nova/tests/rpc/test_qpid.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/rpc/test_qpid.py b/nova/tests/rpc/test_qpid.py index 9e318fbfd..f96b714bd 100644 --- a/nova/tests/rpc/test_qpid.py +++ b/nova/tests/rpc/test_qpid.py @@ -25,7 +25,6 @@ import mox from nova import context from nova import log as logging from nova import test -import nova.rpc.amqp as rpc_amqp try: import qpid @@ -186,10 +185,10 @@ class RpcQpidTestCase(test.TestCase): self.mocker.VerifyAll() finally: - while rpc_amqp.ConnectionContext._connection_pool.free_items: + while impl_qpid.Connection.pool.free_items: # Pull the mock connection object out of the connection pool so # that it doesn't mess up other test cases. - rpc_amqp.ConnectionContext._connection_pool.get() + impl_qpid.Connection.pool.get() @test.skip_if(qpid is None, "Test requires qpid") def test_cast(self): @@ -265,10 +264,10 @@ class RpcQpidTestCase(test.TestCase): self.mocker.VerifyAll() finally: - while rpc_amqp.ConnectionContext._connection_pool.free_items: + while impl_qpid.Connection.pool.free_items: # Pull the mock connection object out of the connection pool so # that it doesn't mess up other test cases. - rpc_amqp.ConnectionContext._connection_pool.get() + impl_qpid.Connection.pool.get() @test.skip_if(qpid is None, "Test requires qpid") def test_call(self): -- cgit