From da539a094da0f4af3d030933867fb73c2d97880f Mon Sep 17 00:00:00 2001
From: Mark McLoughlin <markmc@redhat.com>
Date: Mon, 29 Jul 2013 07:38:29 +0100
Subject: [PATCH] Add initial qpid driver

This just adds a QpidDriver which re-uses AMQPDriver.

The test-rabbit-{client,server}.py test scripts works fine with this
driver and the URL changed to qpid:///

Change-Id: Ifb72853e83b678b311fecb21fe016af19a67b272
---
 oslo/messaging/_drivers/impl_qpid.py | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/oslo/messaging/_drivers/impl_qpid.py b/oslo/messaging/_drivers/impl_qpid.py
index afc76797f..aacb130c9 100644
--- a/oslo/messaging/_drivers/impl_qpid.py
+++ b/oslo/messaging/_drivers/impl_qpid.py
@@ -25,8 +25,9 @@ import eventlet
 import greenlet
 from oslo.config import cfg
 
-from oslo.messaging._drivers.rpc import amqp as rpc_amqp
-from oslo.messaging._drivers.rpc import common as rpc_common
+from oslo.messaging._drivers import amqp as rpc_amqp
+from oslo.messaging._drivers import amqpdriver
+from oslo.messaging._drivers import common as rpc_common
 from oslo.messaging.openstack.common import excutils
 from oslo.messaging.openstack.common import importutils
 from oslo.messaging.openstack.common import jsonutils
@@ -737,3 +738,15 @@ def notify(conf, context, topic, msg, envelope):
 
 def cleanup():
     return rpc_amqp.cleanup(Connection.pool)
+
+
+class QpidDriver(amqpdriver.AMQPDriverBase):
+
+    def __init__(self, conf, url=None, default_exchange=None):
+        conf.register_opts(qpid_opts)
+        conf.register_opts(rpc_amqp.amqp_opts)
+
+        connection_pool = rpc_amqp.get_connection_pool(conf, Connection)
+
+        super(QpidDriver, self).__init__(conf, connection_pool,
+                                         url, default_exchange)