[PATCH 04/11] Don't re-add deleted or hidden devices during DeviceTree.populate.

David Lehman dlehman at redhat.com
Mon Feb 4 23:32:30 UTC 2013


---
 blivet/devicetree.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index a627398..eee8ed6 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -922,6 +922,19 @@ class DeviceTree(object):
         uuid = udev_device_get_uuid(info)
         sysfs_path = udev_device_get_sysfs_path(info)
 
+        # make sure this device was not scheduled for removal and also has not
+        # been hidden
+        removed = self.findActions(type="destroy", object="device")
+        for ignored in removed + self._hidden:
+            if ignored.sysfsPath == sysfs_path or \
+               uuid in (ignored.uuid, ignored.format.uuid):
+                if ignored in removed:
+                    reason = "removed"
+                else:
+                    reason = "hidden"
+
+                log.debug("skipping %s device %s" % (reason, name))
+
         # make sure we note the name of every device we see
         if name not in self.names:
             self.names.append(name)
-- 
1.8.1



More information about the anaconda-patches mailing list