diff options
author | Jenkins <jenkins@review.openstack.org> | 2012-12-18 00:35:27 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2012-12-18 00:35:27 +0000 |
commit | 8888ad0126f25c91b90f7bc4c2440da0bf35ec1d (patch) | |
tree | 1c0ad0ac97c1535ba9c4893ceffe216c50c993b3 /openstack/common/rpc | |
parent | 91c9631bd3e3a0c72b36840ddf90e1db483f9a14 (diff) | |
parent | 17bb753daaf43bad656ae88393da3c6709f4d8e3 (diff) | |
download | oslo-8888ad0126f25c91b90f7bc4c2440da0bf35ec1d.tar.gz oslo-8888ad0126f25c91b90f7bc4c2440da0bf35ec1d.tar.xz oslo-8888ad0126f25c91b90f7bc4c2440da0bf35ec1d.zip |
Merge "Register the control_exchange RPC option"
Diffstat (limited to 'openstack/common/rpc')
-rw-r--r-- | openstack/common/rpc/__init__.py | 16 | ||||
-rw-r--r-- | openstack/common/rpc/amqp.py | 6 |
2 files changed, 9 insertions, 13 deletions
diff --git a/openstack/common/rpc/__init__.py b/openstack/common/rpc/__init__.py index e11fa16..902cea2 100644 --- a/openstack/common/rpc/__init__.py +++ b/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/openstack/common/rpc/amqp.py b/openstack/common/rpc/amqp.py index 193b621..00b2f24 100644 --- a/openstack/common/rpc/amqp.py +++ b/openstack/common/rpc/amqp.py @@ -33,7 +33,6 @@ from eventlet import greenpool from eventlet import pools from eventlet import semaphore -from openstack.common import cfg from openstack.common import excutils from openstack.common.gettextutils import _ from openstack.common import local @@ -428,7 +427,4 @@ def cleanup(connection_pool): def get_control_exchange(conf): - try: - return conf.control_exchange - except cfg.NoSuchOptError: - return 'openstack' + return conf.control_exchange |