From fa67c6c414d1065c9bc1b626129c80bee81720c1 Mon Sep 17 00:00:00 2001 From: David Lehman Date: Fri, 13 Mar 2009 14:15:25 -0500 Subject: Don't traceback if vg.teardown fails in recursive teardown. It's possible that another lv in the same vg either has a filesystem mounted or an active luks mapping, so just carry on. --- storage/devices.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/storage/devices.py b/storage/devices.py index fffebca84..39ffcf74d 100644 --- a/storage/devices.py +++ b/storage/devices.py @@ -1860,7 +1860,13 @@ class LVMLogicalVolumeDevice(DMDevice): lvm.lvdeactivate(self.vg.name, self._name) if recursive: - self.vg.teardown(recursive=recursive) + # It's likely that teardown of a VG will fail due to other + # LVs being active (filesystems mounted, &c), so don't let + # it bring everything down. + try: + self.vg.teardown(recursive=recursive) + except Exception as e: + log.debug("vg %s teardown failed; continuing" % self.vg.name) def create(self, intf=None): """ Create the device. """ -- cgit