Eduardo has uploaded a new change for review.
Change subject: CannotRemoveLogicalVolume is raised with arguments.
......................................................................
CannotRemoveLogicalVolume is raised with arguments.
Change-Id: Ied29c1dddf4e9d6cf890cb66d362acf9eed99ba6
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/lvm.py
M vdsm/storage/storage_exception.py
2 files changed, 7 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/8808/1
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 78c846a..88d818b 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -1015,7 +1015,7 @@
if _isLVActive(vgName, lvName):
#Fix me
#Should not remove active LVs
- #raise se.CannotRemoveLogicalVolume(vgName, lvName)
+ #raise se.CannotRemoveLogicalVolume(vgName, (lvName,))
log.warning("Removing active volume %s/%s" % (vgName, lvName))
#LV exists or not in cache, attempting to remove it.
@@ -1036,7 +1036,7 @@
else:
# Otherwise LV info needs to be refreshed
_lvminfo._invalidatelvs(vgName, lvName)
- raise se.CannotRemoveLogicalVolume(vgName, str(lvNames))
+ raise se.CannotRemoveLogicalVolume(vgName, lvNames)
def extendLV(vgName, lvName, size):
diff --git a/vdsm/storage/storage_exception.py b/vdsm/storage/storage_exception.py
index 54e64e6..b5f63da 100644
--- a/vdsm/storage/storage_exception.py
+++ b/vdsm/storage/storage_exception.py
@@ -1305,8 +1305,12 @@
class CannotRemoveLogicalVolume(StorageException):
+ def __init__(self, vgName, lvNames):
+ self.value("vg: %s lvs: %s", vgName, ", ".join(lvNames))
+ self.vg = vgName
+ self.lvs = lvNames
code = 551
- message = "Cannot remove Logical Volume"
+ message = "Failed to remove some LVs."
class CannotDeactivateLogicalVolume(StorageException):
--
To view, visit
http://gerrit.ovirt.org/8808
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied29c1dddf4e9d6cf890cb66d362acf9eed99ba6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>