diff options
| author | Mark McLoughlin <markmc@redhat.com> | 2012-12-11 07:18:35 +0000 |
|---|---|---|
| committer | Mark McLoughlin <markmc@redhat.com> | 2013-01-04 13:42:22 +0000 |
| commit | f80e924737c0db8025aa71cad2f83f74f8ea742b (patch) | |
| tree | 574dd9ccc06409b756140a12d0f62f10f9bd1ae7 /nova/openstack | |
| parent | b6843ad968ca03797d968625e8bec814caa42aa0 (diff) | |
| download | nova-f80e924737c0db8025aa71cad2f83f74f8ea742b.tar.gz nova-f80e924737c0db8025aa71cad2f83f74f8ea742b.tar.xz nova-f80e924737c0db8025aa71cad2f83f74f8ea742b.zip | |
Clean up setting of control_exchange default
The RPC code from Oslo now registers the control_exchange option but
provides us with an API for changing the default.
blueprint: scope-config-opts
Change-Id: Ie7950daaddb53f38eb72d2a113e1f26252dd6903
Diffstat (limited to 'nova/openstack')
| -rw-r--r-- | nova/openstack/common/rpc/__init__.py | 16 | ||||
| -rw-r--r-- | nova/openstack/common/rpc/amqp.py | 5 |
2 files changed, 9 insertions, 12 deletions
diff --git a/nova/openstack/common/rpc/__init__.py b/nova/openstack/common/rpc/__init__.py index a223e8fde..cfdac03bd 100644 --- a/nova/openstack/common/rpc/__init__.py +++ b/nova/openstack/common/rpc/__init__.py @@ -57,19 +57,19 @@ rpc_opts = [ cfg.BoolOpt('fake_rabbit', default=False, help='If passed, use a fake RabbitMQ provider'), - # - # The following options are not registered here, but are expected to be - # present. The project using this library must register these options with - # the configuration so that project-specific defaults may be defined. - # - #cfg.StrOpt('control_exchange', - # default='nova', - # help='AMQP exchange to connect to if using RabbitMQ or Qpid'), + cfg.StrOpt('control_exchange', + default='openstack', + help='AMQP exchange to connect to if using RabbitMQ or Qpid'), ] cfg.CONF.register_opts(rpc_opts) +def set_defaults(control_exchange): + cfg.set_defaults(rpc_opts, + control_exchange=control_exchange) + + def create_connection(new=True): """Create a connection to the message bus used for rpc. diff --git a/nova/openstack/common/rpc/amqp.py b/nova/openstack/common/rpc/amqp.py index a5a79cc30..6464914db 100644 --- a/nova/openstack/common/rpc/amqp.py +++ b/nova/openstack/common/rpc/amqp.py @@ -428,7 +428,4 @@ def cleanup(connection_pool): def get_control_exchange(conf): - try: - return conf.control_exchange - except cfg.NoSuchOptError: - return 'openstack' + return conf.control_exchange |
