From: Thang Pham Date: Sat, 26 Jul 2014 00:37:06 +0000 (-0400) Subject: Remove reattach function in cinder-manage X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=2581edd8e45deed7e43530e5890925f9fc81e143;p=openstack-build%2Fcinder-build.git Remove reattach function in cinder-manage The reattach function in cinder-manage depends on db.instance_get, which is not available in cinder db. db.instance_get is only available in nova db. Hence, the reattach function should be removed from cinder-manage. Change-Id: If33bf2f281735bd530641c1e6d15e9645f38b4b4 Closes-Bug: #1167931 --- diff --git a/bin/cinder-manage b/bin/cinder-manage index 1e9762ce8..0b25ae3ab 100755 --- a/bin/cinder-manage +++ b/bin/cinder-manage @@ -279,25 +279,6 @@ class VolumeCommands(object): cctxt = self.client.prepare(server=host) cctxt.cast(ctxt, "delete_volume", volume_id=volume['id']) - @args('volume_id', - help='Volume ID to be reattached') - def reattach(self, volume_id): - """Re-attach a volume that has previously been attached - to an instance. Typically called after a compute host - has been rebooted. - """ - ctxt = context.get_admin_context() - volume = db.volume_get(ctxt, param2id(volume_id)) - if not volume['instance_id']: - print(_("volume is not attached to an instance")) - return - instance = db.instance_get(ctxt, volume['instance_id']) - host = instance['host'] - - cctxt = self.client.prepare(topic=CONF.compute_topic, server=host) - cctxt.cast(ctxt, "attach_volume", instance_id=instance['id'], - volume_id=volume['id'], mountpoint=volume['mountpoint']) - @args('--currenthost', required=True, help='Existing volume host name') @args('--newhost', required=True, help='New volume host name') def update_host(self, currenthost, newhost):