From: Walter A. Boring IV Date: Thu, 26 Mar 2015 05:04:00 +0000 (+0000) Subject: Hitachi: Fix access to volume instance_uuid X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=2fc920a55c39af815641b85f7d71458257202a1b;p=openstack-build%2Fcinder-build.git Hitachi: Fix access to volume instance_uuid 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 --- diff --git a/cinder/volume/drivers/hitachi/hbsd_fc.py b/cinder/volume/drivers/hitachi/hbsd_fc.py index 1c40aaa4e..34b839ee0 100644 --- a/cinder/volume/drivers/hitachi/hbsd_fc.py +++ b/cinder/volume/drivers/hitachi/hbsd_fc.py @@ -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) diff --git a/cinder/volume/drivers/hitachi/hbsd_iscsi.py b/cinder/volume/drivers/hitachi/hbsd_iscsi.py index 87e99e82f..07a20d84a 100644 --- a/cinder/volume/drivers/hitachi/hbsd_iscsi.py +++ b/cinder/volume/drivers/hitachi/hbsd_iscsi.py @@ -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)