Deprecate usage of amqp_url in favor of oslo.messaging backend config

This deprecates usage of the old amqp_url in favor of using backend-specific
oslo.messaging configuration.  Removes the old, pre-Liberty options and silences
a bunch of deprecation warnings to boot.

Change-Id: Ib666901c28f66a7616aa445ecc7120fe9d1e1364
Closes-bug: #1524595
This commit is contained in:
Adam Gandelman 2015-12-10 17:32:16 -08:00
parent de6ade7bd5
commit e92c2e8da5
6 changed files with 25 additions and 19 deletions

View File

@ -19,6 +19,8 @@
"""
import abc
import logging
import os
import sys
from cliff import command
@ -39,14 +41,12 @@ class MessageSending(command.Command):
return {}
def take_action(self, parsed_args):
self.log.info(
'using amqp at %r exchange %r',
self.app.rug_ini.amqp_url,
self.app.rug_ini.outgoing_notifications_exchange,
)
self.send_message(self.make_message(parsed_args))
def send_message(self, payload):
sender = notifications.Sender()
self.log.debug('sending %r', payload)
cmd = payload.get('command')
argv = os.path.basename(sys.argv[0])
self.log.info('%s: sending %s instruction.' % (argv, cmd))
self.log.debug('payload: %r', payload)
sender.send(event_type='astara.command', message=payload)

View File

@ -28,10 +28,6 @@ class Poll(message.MessageSending):
log = logging.getLogger(__name__)
def make_message(self, parsed_args):
self.log.info(
'sending %s instruction',
commands.POLL,
)
return {
'command': commands.POLL,
}

View File

@ -57,9 +57,6 @@ NOTIFICATIONS_OPTS = [
cfg.StrOpt('incoming-notifications-exchange',
default='neutron',
help='name of the exchange where we receive notifications'),
cfg.StrOpt('outgoing-notifications-exchange',
default='neutron',
help='name of the exchange where we send notifications'),
cfg.StrOpt('rpc-exchange',
default='l3_agent_fanout',
help='name of the exchange where we receive RPC calls'),

View File

@ -66,7 +66,8 @@ function configure_astara() {
cp $ASTARA_DIR/etc/orchestrator.ini $ASTARA_CONF
iniset $ASTARA_CONF DEFAULT verbose True
configure_auth_token_middleware $ASTARA_CONF $Q_ADMIN_USERNAME $ASTARA_CACHE_DIR
iniset $ASTARA_CONF DEFAULT amqp_url "amqp://$RABBIT_USERID:$RABBIT_PASSWORD@$RABBIT_HOST:$RABBIT_PORT/"
iniset_rpc_backend astara $ASTARA_CONF
iniset $ASTARA_CONF DEFAULT control_exchange "neutron"
iniset $ASTARA_CONF DEFAULT boot_timeout "6000"
iniset $ASTARA_CONF DEFAULT num_worker_processes "2"

View File

@ -43,12 +43,13 @@ router_ssh_public_key=/etc/astara/astara.pub
interface_driver=astara.common.linux.interface.OVSInterfaceDriver
ovs_integration_bridge=br-int
# URL for connecting to oslo.messaging backend
amqp_url = amqp://rabbit:astara@127.0.0.1:/
# oslo_messaging backend configuration, rabbitmq client credentials
# configured in [oslo_messaging_rabbit] section.
rpc_backend = rabbit
# *Deprecated* use amqp_url instead.
rabbit_password = yetanothersecret
rabbit_host = 192.168.57.200
# *Deprecated* Use [oslo_messaging_rabbit] for configuring amqp
# client credentials.
#amqp_url = amqp://rabbit:astara@127.0.0.1:/
provider_rules_path=/opt/stack/astara/etc/provider_rules.json
control_exchange = quantum
@ -80,6 +81,12 @@ username = neutron
auth_url = http://127.0.0.1:35357
auth_plugin = password
# This section should be updated as per rabbitmq credentials
[oslo_messaging_rabbit]
rabbit_userid = rabbit
rabbit_password = secret
rabbit_hosts = 127.0.0.1
# Driver configuration
[router]
image_uuid = aa7bcd8e-7364-11e5-a721-a35eacf37e3b

View File

@ -0,0 +1,5 @@
---
deprecations:
- The ``amqp_url`` config option has been deprecated in favor using ``oslo.messaging`` backend specific configution. See example configuration file for an example. The pre-Liberty rabbit options have been removed.
fixes:
- Bug `1524595 <https://bugs.launchpad.net/astara/+bug/1524595/>`_ astara-ctl warning message for deprecated AMQP configuration