From e72a8d5bc4dcbd6542658ea9617ed04ea44673eb Mon Sep 17 00:00:00 2001 From: Kenneth Giusti Date: Mon, 9 May 2016 12:56:02 -0400 Subject: [PATCH] Reorganize the AMQP 1.0 driver source files This patch simply moves the existing AMQP 1.0 driver files into a directory layout that is consistent with the other drivers. The driver unit tests are also moved to the proper test directory. There are no changes in driver functionality or API. Change-Id: I83a5d5433be8c3b317597100af69192ec5be81f1 Closes-Bug: #1579823 --- .../_drivers/{protocols => amqp1_driver}/__init__.py | 0 .../_drivers/{protocols/amqp => amqp1_driver}/controller.py | 4 ++-- .../_drivers/{protocols/amqp => amqp1_driver}/drivertasks.py | 2 +- .../_drivers/{protocols/amqp => amqp1_driver}/eventloop.py | 0 .../_drivers/{protocols/amqp => amqp1_driver}/opts.py | 0 .../_drivers/{protocols/amqp/driver.py => impl_amqp1.py} | 4 ++-- oslo_messaging/_drivers/protocols/amqp/__init__.py | 0 oslo_messaging/conffixture.py | 2 +- oslo_messaging/opts.py | 2 +- oslo_messaging/tests/{ => drivers}/test_amqp_driver.py | 2 +- setup.cfg | 2 +- 11 files changed, 9 insertions(+), 9 deletions(-) rename oslo_messaging/_drivers/{protocols => amqp1_driver}/__init__.py (100%) rename oslo_messaging/_drivers/{protocols/amqp => amqp1_driver}/controller.py (99%) rename oslo_messaging/_drivers/{protocols/amqp => amqp1_driver}/drivertasks.py (98%) rename oslo_messaging/_drivers/{protocols/amqp => amqp1_driver}/eventloop.py (100%) rename oslo_messaging/_drivers/{protocols/amqp => amqp1_driver}/opts.py (100%) rename oslo_messaging/_drivers/{protocols/amqp/driver.py => impl_amqp1.py} (99%) delete mode 100644 oslo_messaging/_drivers/protocols/amqp/__init__.py rename oslo_messaging/tests/{ => drivers}/test_amqp_driver.py (99%) diff --git a/oslo_messaging/_drivers/protocols/__init__.py b/oslo_messaging/_drivers/amqp1_driver/__init__.py similarity index 100% rename from oslo_messaging/_drivers/protocols/__init__.py rename to oslo_messaging/_drivers/amqp1_driver/__init__.py diff --git a/oslo_messaging/_drivers/protocols/amqp/controller.py b/oslo_messaging/_drivers/amqp1_driver/controller.py similarity index 99% rename from oslo_messaging/_drivers/protocols/amqp/controller.py rename to oslo_messaging/_drivers/amqp1_driver/controller.py index 2c115a865..25e22d5f1 100644 --- a/oslo_messaging/_drivers/protocols/amqp/controller.py +++ b/oslo_messaging/_drivers/amqp1_driver/controller.py @@ -34,8 +34,8 @@ import proton import pyngus from six import moves -from oslo_messaging._drivers.protocols.amqp import eventloop -from oslo_messaging._drivers.protocols.amqp import opts +from oslo_messaging._drivers.amqp1_driver import eventloop +from oslo_messaging._drivers.amqp1_driver import opts from oslo_messaging._i18n import _LE, _LI, _LW from oslo_messaging import exceptions from oslo_messaging import transport diff --git a/oslo_messaging/_drivers/protocols/amqp/drivertasks.py b/oslo_messaging/_drivers/amqp1_driver/drivertasks.py similarity index 98% rename from oslo_messaging/_drivers/protocols/amqp/drivertasks.py rename to oslo_messaging/_drivers/amqp1_driver/drivertasks.py index 0addc0758..c36cce597 100644 --- a/oslo_messaging/_drivers/protocols/amqp/drivertasks.py +++ b/oslo_messaging/_drivers/amqp1_driver/drivertasks.py @@ -16,7 +16,7 @@ import logging import threading import time -from oslo_messaging._drivers.protocols.amqp import controller +from oslo_messaging._drivers.amqp1_driver import controller from oslo_messaging._i18n import _LW from oslo_messaging import exceptions diff --git a/oslo_messaging/_drivers/protocols/amqp/eventloop.py b/oslo_messaging/_drivers/amqp1_driver/eventloop.py similarity index 100% rename from oslo_messaging/_drivers/protocols/amqp/eventloop.py rename to oslo_messaging/_drivers/amqp1_driver/eventloop.py diff --git a/oslo_messaging/_drivers/protocols/amqp/opts.py b/oslo_messaging/_drivers/amqp1_driver/opts.py similarity index 100% rename from oslo_messaging/_drivers/protocols/amqp/opts.py rename to oslo_messaging/_drivers/amqp1_driver/opts.py diff --git a/oslo_messaging/_drivers/protocols/amqp/driver.py b/oslo_messaging/_drivers/impl_amqp1.py similarity index 99% rename from oslo_messaging/_drivers/protocols/amqp/driver.py rename to oslo_messaging/_drivers/impl_amqp1.py index 50d0036a9..792152cf0 100644 --- a/oslo_messaging/_drivers/protocols/amqp/driver.py +++ b/oslo_messaging/_drivers/impl_amqp1.py @@ -39,10 +39,10 @@ from oslo_messaging import target as messaging_target proton = importutils.try_import('proton') controller = importutils.try_import( - 'oslo_messaging._drivers.protocols.amqp.controller' + 'oslo_messaging._drivers.amqp1_driver.controller' ) drivertasks = importutils.try_import( - 'oslo_messaging._drivers.protocols.amqp.drivertasks' + 'oslo_messaging._drivers.amqp1_driver.drivertasks' ) LOG = logging.getLogger(__name__) diff --git a/oslo_messaging/_drivers/protocols/amqp/__init__.py b/oslo_messaging/_drivers/protocols/amqp/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/oslo_messaging/conffixture.py b/oslo_messaging/conffixture.py index bb037b8db..c6edddd07 100644 --- a/oslo_messaging/conffixture.py +++ b/oslo_messaging/conffixture.py @@ -55,7 +55,7 @@ class ConfFixture(fixtures.Fixture): 'oslo_messaging._drivers.amqp', 'amqp_opts', 'oslo_messaging_qpid') _import_opts(self.conf, - 'oslo_messaging._drivers.protocols.amqp.opts', + 'oslo_messaging._drivers.amqp1_driver.opts', 'amqp1_opts', 'oslo_messaging_amqp') _import_opts(self.conf, 'oslo_messaging._drivers.impl_zmq', 'zmq_opts') diff --git a/oslo_messaging/opts.py b/oslo_messaging/opts.py index 068774336..b04768a28 100644 --- a/oslo_messaging/opts.py +++ b/oslo_messaging/opts.py @@ -21,12 +21,12 @@ import copy import itertools from oslo_messaging._drivers import amqp +from oslo_messaging._drivers.amqp1_driver import opts as amqp_opts from oslo_messaging._drivers import base as drivers_base from oslo_messaging._drivers import impl_pika from oslo_messaging._drivers import impl_rabbit from oslo_messaging._drivers import impl_zmq from oslo_messaging._drivers.pika_driver import pika_connection_factory -from oslo_messaging._drivers.protocols.amqp import opts as amqp_opts from oslo_messaging._drivers.zmq_driver.matchmaker import matchmaker_redis from oslo_messaging.notify import notifier from oslo_messaging.rpc import client diff --git a/oslo_messaging/tests/test_amqp_driver.py b/oslo_messaging/tests/drivers/test_amqp_driver.py similarity index 99% rename from oslo_messaging/tests/test_amqp_driver.py rename to oslo_messaging/tests/drivers/test_amqp_driver.py index af6724dba..d6e92558c 100644 --- a/oslo_messaging/tests/test_amqp_driver.py +++ b/oslo_messaging/tests/drivers/test_amqp_driver.py @@ -36,7 +36,7 @@ from oslo_messaging.tests import utils as test_utils # are available in the base repos for all supported platforms. pyngus = importutils.try_import("pyngus") if pyngus: - from oslo_messaging._drivers.protocols.amqp import driver as amqp_driver + import oslo_messaging._drivers.impl_amqp1 as amqp_driver # The Cyrus-based SASL tests can only be run if the installed version of proton # has been built with Cyrus SASL support. diff --git a/setup.cfg b/setup.cfg index 05c0f3d1c..aa6f2d55c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,7 +30,7 @@ console_scripts = oslo.messaging.drivers = rabbit = oslo_messaging._drivers.impl_rabbit:RabbitDriver zmq = oslo_messaging._drivers.impl_zmq:ZmqDriver - amqp = oslo_messaging._drivers.protocols.amqp.driver:ProtonDriver + amqp = oslo_messaging._drivers.impl_amqp1:ProtonDriver # This driver is supporting for only notification usage kafka = oslo_messaging._drivers.impl_kafka:KafkaDriver