From 2581edd8e45deed7e43530e5890925f9fc81e143 Mon Sep 17 00:00:00 2001 From: Thang Pham Date: Fri, 25 Jul 2014 20:37:06 -0400 Subject: [PATCH] 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 --- bin/cinder-manage | 19 ------------------- 1 file changed, 19 deletions(-) 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): -- 2.45.2