summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-05-29 21:15:58 -0400
committerRussell Bryant <rbryant@redhat.com>2012-05-31 15:19:31 -0400
commit23cfb85e385478df01b0623afb07a8995fa801cc (patch)
treeb6b5756f04b0ec5a30b6ee001d7d7dd4e48b55e5
parentf9986b8be0d577e9e44cae1c8a9afe308af868f9 (diff)
downloadnova-23cfb85e385478df01b0623afb07a8995fa801cc.tar.gz
nova-23cfb85e385478df01b0623afb07a8995fa801cc.tar.xz
nova-23cfb85e385478df01b0623afb07a8995fa801cc.zip
Use compute rpcapi in nova-manage.
Part of bug 1006467. This patch fixes nova-manage to use the compute rpcapi instead of calling rpc.cast() directly. This cast was actually broken, as it sent an instance ID instead of UUID, so this change should make this code functional again. Change-Id: I90a1bf4a03cc6d9e21f24f19165141f894b6ec75
-rwxr-xr-xbin/nova-manage11
1 files changed, 4 insertions, 7 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index 1554251a0..727b1cc3f 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -80,6 +80,7 @@ from nova.api.ec2 import ec2utils
from nova.auth import manager
from nova.compat import flagfile
from nova.compute import instance_types
+from nova.compute import rpcapi as compute_rpcapi
from nova import context
from nova import crypto
from nova import db
@@ -1169,13 +1170,9 @@ class VolumeCommands(object):
print "volume is not attached to an instance"
return
instance = db.instance_get(ctxt, volume['instance_id'])
- host = instance['host']
- rpc.cast(ctxt,
- rpc.queue_get_for(ctxt, FLAGS.compute_topic, host),
- {"method": "attach_volume",
- "args": {"instance_id": instance['id'],
- "volume_id": volume['id'],
- "mountpoint": volume['mountpoint']}})
+ rpcapi = compute_rpcapi.ComputeAPI()
+ rpcapi.attach_volume(ctxt, instance, volume['id'],
+ volume['mountpoint'])
class InstanceTypeCommands(object):