Since the superclass _postDestroy method sets self.exists to False, and
self.status can only be True for devices that exist, we cannot rely on
self.status to see if the device node remains.
---
blivet/devices/partition.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py
index 8db8254..df762a4 100644
--- a/blivet/devices/partition.py
+++ b/blivet/devices/partition.py
@@ -19,6 +19,7 @@
# Red Hat Author(s): David Lehman <dlehman(a)redhat.com>
#
+import os
import parted
import _ped
@@ -687,7 +688,8 @@ class PartitionDevice(StorageDevice):
super(PartitionDevice, self)._postDestroy()
if isinstance(self.disk, DMDevice):
udev.settle()
- if self.status:
+ # self.exists has been unset, so don't use self.status
+ if os.path.exists(self.path):
try:
dm.dm_remove(self.name)
except (errors.DMError, OSError):
--
1.9.3