]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Hitachi: Fix access to volume instance_uuid
authorWalter A. Boring IV <walter.boring@hp.com>
Thu, 26 Mar 2015 05:04:00 +0000 (05:04 +0000)
committerWalter A. Boring IV <walter.boring@hp.com>
Fri, 27 Mar 2015 15:02:39 +0000 (08:02 -0700)
The instance_uuid and attached_host no longer exists
in the volume object.  It's part of the attachments that
show up in volume['volume_attachment'].

This patch now tests to see if there are any volume
attachments at all via the volume['volume_attachment'] list.

Change-Id: I6b06adaf408e9458a9d4d8c73a6749bd3a282340
Closes-Bug: 1436605

cinder/volume/drivers/hitachi/hbsd_fc.py
cinder/volume/drivers/hitachi/hbsd_iscsi.py

index 1c40aaa4ea80053d21168df03ff0c474bffc67b9..34b839ee0ed5cb96739b45895461acbf7f08182a 100644 (file)
@@ -505,7 +505,7 @@ class HBSDFCDriver(cinder.volume.driver.FibreChannelDriver):
 
     def copy_volume_to_image(self, context, volume, image_service, image_meta):
         self.do_setup_status.wait()
-        if (volume['instance_uuid'] or volume['attached_host']):
+        if volume['volume_attachment']:
             desc = 'volume %s' % volume['id']
             msg = basic_lib.output_err(660, desc=desc)
             raise exception.HBSDError(message=msg)
index 87e99e82fa21136d469e3e59ecc6034d0f52788e..07a20d84a6e75486e66deca5adae6acd634351b9 100644 (file)
@@ -410,7 +410,7 @@ class HBSDISCSIDriver(cinder.volume.driver.ISCSIDriver):
 
     def copy_volume_to_image(self, context, volume, image_service, image_meta):
         self.do_setup_status.wait()
-        if (volume['instance_uuid'] or volume['attached_host']):
+        if volume['volume_attachment']:
             desc = 'volume %s' % volume['id']
             msg = basic_lib.output_err(660, desc=desc)
             raise exception.HBSDError(message=msg)