Merge "Move queue_get_for() from db to rpc."

This commit is contained in:
Jenkins
2012-05-31 01:29:40 +00:00
committed by Gerrit Code Review
2 changed files with 7 additions and 2 deletions

View File

@@ -1153,7 +1153,7 @@ class VolumeCommands(object):
return
rpc.cast(ctxt,
db.queue_get_for(ctxt, FLAGS.volume_topic, host),
rpc.queue_get_for(ctxt, FLAGS.volume_topic, host),
{"method": "delete_volume",
"args": {"volume_id": volume['id']}})
@@ -1171,7 +1171,7 @@ class VolumeCommands(object):
instance = db.instance_get(ctxt, volume['instance_id'])
host = instance['host']
rpc.cast(ctxt,
db.queue_get_for(ctxt, FLAGS.compute_topic, host),
rpc.queue_get_for(ctxt, FLAGS.compute_topic, host),
{"method": "attach_volume",
"args": {"instance_id": instance['id'],
"volume_id": volume['id'],

View File

@@ -226,6 +226,11 @@ def fanout_cast_to_server(context, server_params, topic, msg):
topic, msg)
def queue_get_for(context, topic, host):
"""Get a queue name for a given topic + host."""
return '%s.%s' % (topic, host)
_RPCIMPL = None