summaryrefslogtreecommitdiffstats
path: root/nova/openstack
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-05 06:43:07 +0000
committerGerrit Code Review <review@openstack.org>2013-01-05 06:43:08 +0000
commitac78bc7596a43de9a0c59a3dfc89faa08805d099 (patch)
tree65a9889992565f9bdecfb64b8488b7c5dd621fc0 /nova/openstack
parenta4053b61b4dc825bb38742f12723d32feb01089f (diff)
parentf80e924737c0db8025aa71cad2f83f74f8ea742b (diff)
downloadnova-ac78bc7596a43de9a0c59a3dfc89faa08805d099.tar.gz
nova-ac78bc7596a43de9a0c59a3dfc89faa08805d099.tar.xz
nova-ac78bc7596a43de9a0c59a3dfc89faa08805d099.zip
Merge "Clean up setting of control_exchange default"
Diffstat (limited to 'nova/openstack')
-rw-r--r--nova/openstack/common/rpc/__init__.py16
-rw-r--r--nova/openstack/common/rpc/amqp.py5
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