]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove reattach function in cinder-manage
authorThang Pham <thang.g.pham@gmail.com>
Sat, 26 Jul 2014 00:37:06 +0000 (20:37 -0400)
committerThang Pham <thang.g.pham@gmail.com>
Sat, 26 Jul 2014 00:37:06 +0000 (20:37 -0400)
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

index 1e9762ce86be0d053a5e3c548640d29dc2714c36..0b25ae3abe39dcf23b61082567e81729ae96790d 100755 (executable)
@@ -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):