Merge "Remove deprecated amqp1 options"

This commit is contained in:
Zuul 2018-09-14 17:46:26 +00:00 committed by Gerrit Code Review
commit ede61c360d
3 changed files with 6 additions and 49 deletions

View File

@ -819,13 +819,10 @@ class NotificationServer(Server):
class Hosts(object): class Hosts(object):
"""An order list of TransportHost addresses. Connection failover progresses """An order list of TransportHost addresses. Connection failover progresses
from one host to the next. username, password , and realm come from the from one host to the next. The default realm comes from the configuration
configuration and are used only if no username/password/realm is present in and is only used if no realm is present in the URL.
the URL.
""" """
def __init__(self, url, default_username=None, def __init__(self, url, default_realm=None):
default_password=None,
default_realm=None):
self.virtual_host = url.virtual_host self.virtual_host = url.virtual_host
if url.hosts: if url.hosts:
self._entries = url.hosts[:] self._entries = url.hosts[:]
@ -834,8 +831,8 @@ class Hosts(object):
port=5672)] port=5672)]
for entry in self._entries: for entry in self._entries:
entry.port = entry.port or 5672 entry.port = entry.port or 5672
entry.username = entry.username or default_username entry.username = entry.username
entry.password = entry.password or default_password entry.password = entry.password
if default_realm and entry.username and '@' not in entry.username: if default_realm and entry.username and '@' not in entry.username:
entry.username = entry.username + '@' + default_realm entry.username = entry.username + '@' + default_realm
self._current = random.randint(0, len(self._entries) - 1) # nosec 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_cert_file = config.oslo_messaging_amqp.ssl_cert_file
self.ssl_key_file = config.oslo_messaging_amqp.ssl_key_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_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.ssl_verify_vhost = config.oslo_messaging_amqp.ssl_verify_vhost
self.pseudo_vhost = config.oslo_messaging_amqp.pseudo_vhost self.pseudo_vhost = config.oslo_messaging_amqp.pseudo_vhost
self.sasl_mechanisms = config.oslo_messaging_amqp.sasl_mechanisms self.sasl_mechanisms = config.oslo_messaging_amqp.sasl_mechanisms
self.sasl_config_dir = config.oslo_messaging_amqp.sasl_config_dir self.sasl_config_dir = config.oslo_messaging_amqp.sasl_config_dir
self.sasl_config_name = config.oslo_messaging_amqp.sasl_config_name self.sasl_config_name = config.oslo_messaging_amqp.sasl_config_name
self.hosts = Hosts(url, config.oslo_messaging_amqp.username, self.hosts = Hosts(url, config.oslo_messaging_amqp.sasl_default_realm)
config.oslo_messaging_amqp.password,
config.oslo_messaging_amqp.sasl_default_realm)
self.conn_retry_interval = \ self.conn_retry_interval = \
config.oslo_messaging_amqp.connection_retry_interval config.oslo_messaging_amqp.connection_retry_interval
self.conn_retry_backoff = \ self.conn_retry_backoff = \

View File

@ -71,14 +71,6 @@ amqp1_opts = [
" if the server's SSL certificate uses the virtual host name" " if the server's SSL certificate uses the virtual host name"
" instead of the DNS 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', cfg.StrOpt('sasl_mechanisms',
default='', default='',
deprecated_group='amqp1', deprecated_group='amqp1',
@ -98,23 +90,6 @@ amqp1_opts = [
default='', default='',
help='SASL realm to use if no realm present in username'), 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 # Network connection failure retry options
cfg.IntOpt('connection_retry_interval', cfg.IntOpt('connection_retry_interval',

View File

@ -904,17 +904,6 @@ mech_list: ${mechs}
addr, addr,
retry=0) 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): def test_authentication_default_realm(self):
"""Verify that default realm is used if none present in username""" """Verify that default realm is used if none present in username"""
addr = "amqp://joe:secret@%s:%d" % (self._broker.host, addr = "amqp://joe:secret@%s:%d" % (self._broker.host,