summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-09-14 17:46:26 +0000
committerGerrit Code Review <review@openstack.org>2018-09-14 17:46:26 +0000
commitede61c360d8e35266ed472a37a8e5f8cde7b970d (patch)
treee80de27dc970262c46b4ce4be53360c7e5b0c14c
parent14c5bed49714179bf5b027bea0676c9841849fd4 (diff)
parent8881ed43784f6e3a62c7c32280ba92d53aabf678 (diff)
downloadoslo-messaging-ede61c360d8e35266ed472a37a8e5f8cde7b970d.tar.gz
Merge "Remove deprecated amqp1 options"
-rw-r--r--oslo_messaging/_drivers/amqp1_driver/controller.py19
-rw-r--r--oslo_messaging/_drivers/amqp1_driver/opts.py25
-rw-r--r--oslo_messaging/tests/drivers/test_amqp_driver.py11
3 files changed, 6 insertions, 49 deletions
diff --git a/oslo_messaging/_drivers/amqp1_driver/controller.py b/oslo_messaging/_drivers/amqp1_driver/controller.py
index 36a8e90..e801dd5 100644
--- a/oslo_messaging/_drivers/amqp1_driver/controller.py
+++ b/oslo_messaging/_drivers/amqp1_driver/controller.py
@@ -819,13 +819,10 @@ class NotificationServer(Server):
class Hosts(object):
"""An order list of TransportHost addresses. Connection failover progresses
- from one host to the next. username, password , and realm come from the
- configuration and are used only if no username/password/realm is present in
- the URL.
+ from one host to the next. The default realm comes from the configuration
+ and is only used if no realm is present in the URL.
"""
- def __init__(self, url, default_username=None,
- default_password=None,
- default_realm=None):
+ def __init__(self, url, default_realm=None):
self.virtual_host = url.virtual_host
if url.hosts:
self._entries = url.hosts[:]
@@ -834,8 +831,8 @@ class Hosts(object):
port=5672)]
for entry in self._entries:
entry.port = entry.port or 5672
- entry.username = entry.username or default_username
- entry.password = entry.password or default_password
+ entry.username = entry.username
+ entry.password = entry.password
if default_realm and entry.username and '@' not in entry.username:
entry.username = entry.username + '@' + default_realm
self._current = random.randint(0, len(self._entries) - 1) # nosec
@@ -894,16 +891,12 @@ class Controller(pyngus.ConnectionEventHandler):
self.ssl_cert_file = config.oslo_messaging_amqp.ssl_cert_file
self.ssl_key_file = config.oslo_messaging_amqp.ssl_key_file
self.ssl_key_password = config.oslo_messaging_amqp.ssl_key_password
- self.ssl_allow_insecure = \
- config.oslo_messaging_amqp.allow_insecure_clients
self.ssl_verify_vhost = config.oslo_messaging_amqp.ssl_verify_vhost
self.pseudo_vhost = config.oslo_messaging_amqp.pseudo_vhost
self.sasl_mechanisms = config.oslo_messaging_amqp.sasl_mechanisms
self.sasl_config_dir = config.oslo_messaging_amqp.sasl_config_dir
self.sasl_config_name = config.oslo_messaging_amqp.sasl_config_name
- self.hosts = Hosts(url, config.oslo_messaging_amqp.username,
- config.oslo_messaging_amqp.password,
- config.oslo_messaging_amqp.sasl_default_realm)
+ self.hosts = Hosts(url, config.oslo_messaging_amqp.sasl_default_realm)
self.conn_retry_interval = \
config.oslo_messaging_amqp.connection_retry_interval
self.conn_retry_backoff = \
diff --git a/oslo_messaging/_drivers/amqp1_driver/opts.py b/oslo_messaging/_drivers/amqp1_driver/opts.py
index d40b611..9165524 100644
--- a/oslo_messaging/_drivers/amqp1_driver/opts.py
+++ b/oslo_messaging/_drivers/amqp1_driver/opts.py
@@ -71,14 +71,6 @@ amqp1_opts = [
" if the server's SSL certificate uses the virtual host name"
" instead of the DNS name."),
- cfg.BoolOpt('allow_insecure_clients',
- default=False,
- deprecated_group='amqp1',
- # marked as deprecated in Ocata
- deprecated_for_removal=True,
- deprecated_reason="Not applicable - not a SSL server",
- help='Accept clients using either SSL or plain TCP'),
-
cfg.StrOpt('sasl_mechanisms',
default='',
deprecated_group='amqp1',
@@ -98,23 +90,6 @@ amqp1_opts = [
default='',
help='SASL realm to use if no realm present in username'),
- cfg.StrOpt('username',
- default='',
- deprecated_group='amqp1',
- deprecated_for_removal=True,
- deprecated_reason='Should use configuration option '
- 'transport_url to provide the username.',
- help='User name for message broker authentication'),
-
- cfg.StrOpt('password',
- default='',
- deprecated_group='amqp1',
- secret=True,
- deprecated_for_removal=True,
- deprecated_reason='Should use configuration option '
- 'transport_url to provide the password.',
- help='Password for message broker authentication'),
-
# Network connection failure retry options
cfg.IntOpt('connection_retry_interval',
diff --git a/oslo_messaging/tests/drivers/test_amqp_driver.py b/oslo_messaging/tests/drivers/test_amqp_driver.py
index 2a8e97f..20f52a4 100644
--- a/oslo_messaging/tests/drivers/test_amqp_driver.py
+++ b/oslo_messaging/tests/drivers/test_amqp_driver.py
@@ -904,17 +904,6 @@ mech_list: ${mechs}
addr,
retry=0)
- def test_authentication_default_username(self):
- """Verify that a configured username/password is used if none appears
- in the URL.
- Deprecated: username password deprecated in favor of transport_url
- """
- addr = "amqp://%s:%d" % (self._broker.host, self._broker.port)
- self.config(username="joe@myrealm",
- password="secret",
- group="oslo_messaging_amqp")
- self._authentication_test(addr)
-
def test_authentication_default_realm(self):
"""Verify that default realm is used if none present in username"""
addr = "amqp://joe:secret@%s:%d" % (self._broker.host,