From 5de04947396e2f4ee2415a49598a771a83bd07a3 Mon Sep 17 00:00:00 2001
From: Steve Kowalik <steven@wedontsleep.org>
Date: Tue, 26 Jun 2018 13:12:00 +1000
Subject: [PATCH] Remove fake_rabbit configuration option

The fake_rabbit configuration option has been deprecated since the
release of 1.5.0 in late 2014. Finally remove it, and its test.

Change-Id: I014c2012cca0f289de0d95b9bb35bbde7f61d2ee
---
 oslo_messaging/_drivers/impl_rabbit.py        | 15 +--------------
 .../tests/drivers/test_impl_rabbit.py         | 19 -------------------
 2 files changed, 1 insertion(+), 33 deletions(-)

diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py
index 72eee80d0..589e01b73 100644
--- a/oslo_messaging/_drivers/impl_rabbit.py
+++ b/oslo_messaging/_drivers/impl_rabbit.py
@@ -194,13 +194,6 @@ rabbit_opts = [
                default=2,
                help='How often times during the heartbeat_timeout_threshold '
                'we check the heartbeat.'),
-
-    # NOTE(sileht): deprecated option since oslo_messaging 1.5.0,
-    cfg.BoolOpt('fake_rabbit',
-                default=False,
-                deprecated_group='DEFAULT',
-                help='Deprecated, use rpc_backend=kombu+memory or '
-                'rpc_backend=fake'),
 ]
 
 LOG = logging.getLogger(__name__)
@@ -463,7 +456,6 @@ class Connection(object):
         self.interval_max = driver_conf.rabbit_interval_max
 
         self.login_method = driver_conf.rabbit_login_method
-        self.fake_rabbit = driver_conf.fake_rabbit
         self.virtual_host = driver_conf.rabbit_virtual_host
         self.rabbit_hosts = driver_conf.rabbit_hosts
         self.rabbit_port = driver_conf.rabbit_port
@@ -501,12 +493,7 @@ class Connection(object):
             virtual_host = self.virtual_host
 
         self._url = ''
-        if self.fake_rabbit:
-            LOG.warning(_LW("Deprecated: fake_rabbit option is deprecated, "
-                            "set rpc_backend to kombu+memory or use the fake "
-                            "driver instead."))
-            self._url = 'memory://%s/' % virtual_host
-        elif url.hosts:
+        if url.hosts:
             if url.transport.startswith('kombu+'):
                 LOG.warning(_LW('Selecting the kombu transport through the '
                                 'transport url (%s) is a experimental feature '
diff --git a/oslo_messaging/tests/drivers/test_impl_rabbit.py b/oslo_messaging/tests/drivers/test_impl_rabbit.py
index d02a0cf9b..74a79595e 100644
--- a/oslo_messaging/tests/drivers/test_impl_rabbit.py
+++ b/oslo_messaging/tests/drivers/test_impl_rabbit.py
@@ -22,7 +22,6 @@ import uuid
 import fixtures
 import kombu
 import kombu.transport.memory
-from oslo_config import cfg
 from oslo_serialization import jsonutils
 import testscenarios
 
@@ -37,24 +36,6 @@ from six.moves import mock
 load_tests = testscenarios.load_tests_apply_scenarios
 
 
-class TestDeprecatedRabbitDriverLoad(test_utils.BaseTestCase):
-
-    def setUp(self):
-        super(TestDeprecatedRabbitDriverLoad, self).setUp(
-            conf=cfg.ConfigOpts())
-        self.messaging_conf.transport_url = 'rabbit:/'
-        self.config(fake_rabbit=True, group="oslo_messaging_rabbit")
-
-    def test_driver_load(self):
-        transport = oslo_messaging.get_transport(self.conf)
-        self.addCleanup(transport.cleanup)
-        driver = transport._driver
-        url = driver._get_connection()._url
-
-        self.assertIsInstance(driver, rabbit_driver.RabbitDriver)
-        self.assertEqual('memory:///', url)
-
-
 class TestHeartbeat(test_utils.BaseTestCase):
 
     @mock.patch('oslo_messaging._drivers.impl_rabbit.LOG')