diff options
author | Michael H Wilson <geekinutah@gmail.com> | 2012-10-16 15:47:52 -0600 |
---|---|---|
committer | Michael H Wilson <geekinutah@gmail.com> | 2012-10-25 23:51:48 -0600 |
commit | 0bf28bec6097d128aa439b288b249fafcac7dbc0 (patch) | |
tree | 348bde399a5efd964741470af9264195899c228e /nova/scheduler/driver.py | |
parent | 5d677e204c99fbcf86e0c721ad2fd327a03c35c2 (diff) | |
download | nova-0bf28bec6097d128aa439b288b249fafcac7dbc0.tar.gz nova-0bf28bec6097d128aa439b288b249fafcac7dbc0.tar.xz nova-0bf28bec6097d128aa439b288b249fafcac7dbc0.zip |
Fix hardcoded topic strings with constants.
Replace hardcoded topic strings like 'volume' or 'compute'
with config constants like FLAGS.volume_topic, etc. See
bug #1057831 and bug #1061628.
Change-Id: I817ecc3cbe3245b51a0c047be58d17edfec8a838
Diffstat (limited to 'nova/scheduler/driver.py')
-rw-r--r-- | nova/scheduler/driver.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/scheduler/driver.py b/nova/scheduler/driver.py index 2c2f95e2d..5cbe925c5 100644 --- a/nova/scheduler/driver.py +++ b/nova/scheduler/driver.py @@ -96,7 +96,7 @@ def cast_to_volume_host(context, host, method, **kwargs): db.volume_update(context, volume_id, {'host': host, 'scheduled_at': now}) rpc.cast(context, - rpc.queue_get_for(context, 'volume', host), + rpc.queue_get_for(context, FLAGS.volume_topic, host), {"method": method, "args": kwargs}) LOG.debug(_("Casted '%(method)s' to volume '%(host)s'") % locals()) @@ -119,7 +119,7 @@ def cast_to_compute_host(context, host, method, **kwargs): instance_update_db(context, instance_uuid) rpc.cast(context, - rpc.queue_get_for(context, 'compute', host), + rpc.queue_get_for(context, FLAGS.compute_topic, host), {"method": method, "args": kwargs}) LOG.debug(_("Casted '%(method)s' to compute '%(host)s'") % locals()) @@ -128,8 +128,8 @@ def cast_to_host(context, topic, host, method, **kwargs): """Generic cast to host""" topic_mapping = { - "compute": cast_to_compute_host, - "volume": cast_to_volume_host} + FLAGS.compute_topic: cast_to_compute_host, + FLAGS.volume_topic: cast_to_volume_host} func = topic_mapping.get(topic) if func: |