Merge "Move queue_get_for() from db to rpc."
This commit is contained in:
@@ -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'],
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user