New patch submitted by David Naori (dnaori(a)redhat.com)
You can review this change at:
http://gerrit.usersys.redhat.com/889
commit aa6e8357d9f2bcf1db3cc8e7d5d75c21434c7f65
Author: David Naori <dnaori(a)redhat.com>
Date: Thu Sep 1 15:42:55 2011 +0300
BZ#735068 - Pass volumeUUID to Exceptions instead of the class instance
Change-Id: Icd1f1cba77c40d4062b0a424dd154ca356e31a0f
diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index 272c997..2fec286 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -251,9 +251,9 @@ class Volume:
"""
self.log.debug("Volume.share)share %s to %s hard %s" % (self.volUUID,
dst_image_dir, hard))
if not self.isShared():
- raise se.VolumeNonShareable(self)
+ raise se.VolumeNonShareable(self.volUUID)
if os.path.basename(dst_image_dir) == os.path.basename(self.imagePath):
- raise se.VolumeOwnershipError(self)
+ raise se.VolumeOwnershipError(self.volUUID)
try:
src = self.getDevPath()
dst = os.path.join(dst_image_dir, self.volUUID)
@@ -374,7 +374,7 @@ class Volume:
raise se.CannotDeleteSharedVolume("img %s vol %s" %
(self.imgUUID, self.volUUID))
children = self.getChildrenList()
if len(children) > 0:
- raise se.VolumeImageHasChildren(self)
+ raise se.VolumeImageHasChildren(self.volUUID)
except se.MetaDataKeyNotFoundError, e:
# In case of metadata key error, we have corrupted
# volume (One of metadata corruptions may be
@@ -536,10 +536,10 @@ class Volume:
if chainrw:
rw = False # Shared cannot be set RW
else:
- raise se.SharedVolumeNonWritable(self)
+ raise se.SharedVolumeNonWritable(self.volUUID)
if not chainrw and rw and self.isInternal() and setrw and not
self.recheckIfLeaf():
- raise se.InternalVolumeNonWritable(self)
+ raise se.InternalVolumeNonWritable(self.volUUID)
self.llPrepare(rw=rw, setrw=setrw)
try: