From 2fc920a55c39af815641b85f7d71458257202a1b Mon Sep 17 00:00:00 2001 From: "Walter A. Boring IV" Date: Thu, 26 Mar 2015 05:04:00 +0000 Subject: [PATCH] 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 --- cinder/volume/drivers/hitachi/hbsd_fc.py | 2 +- cinder/volume/drivers/hitachi/hbsd_iscsi.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cinder/volume/drivers/hitachi/hbsd_fc.py b/cinder/volume/drivers/hitachi/hbsd_fc.py index 1c40aaa4ea8..34b839ee0ed 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 87e99e82fa2..07a20d84a6e 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)