diff options
| author | Russell Bryant <rbryant@redhat.com> | 2012-02-07 22:31:27 -0500 |
|---|---|---|
| committer | Russell Bryant <rbryant@redhat.com> | 2012-02-08 12:21:01 -0500 |
| commit | e0efd7551d0d4e1c23111419f0622a1994601fda (patch) | |
| tree | f41e1e8e269b6cc12b986a4ab4d5d6768d6d7519 /nova/tests | |
| parent | 27ac9d5f0ca4279753ee2984769094f2b4191619 (diff) | |
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
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/rpc/test_qpid.py | 9 |
1 files changed, 4 insertions, 5 deletions
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): |
