[blivet:rhel7/master 8/8] When copying a root, also copy hidden devices (#1043763)

mulhern amulhern at redhat.com
Mon Mar 3 21:33:46 UTC 2014


Related: rhbz#1043763

Otherwise, even if the devices are unhidden the roots mounts or swaps will
remain empty.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/__init__.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/blivet/__init__.py b/blivet/__init__.py
index 19bcfb1..f87767f 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -1952,18 +1952,15 @@ class Blivet(object):
             p = partition.disk.format.partedDisk.getPartitionByPath(partition.path)
             partition.partedPartition = p
 
-        # make sure the roots reference devices in self.devicetree._devices
         for root in new.roots:
-            root.swaps = [new.devicetree.getDeviceByID(d.id) for d in root.swaps]
-            # the above will put None in the list if the swap has since been
-            # removed, which is problematic
+            root.swaps = [new.devicetree.getDeviceByID(d.id, hidden=True) for d in root.swaps]
             root.swaps = [s for s in root.swaps if s]
 
             for (mountpoint, old_dev) in root.mounts.items():
                 if old_dev is None:
                     continue
 
-                new_dev = new.devicetree.getDeviceByID(old_dev.id)
+                new_dev = new.devicetree.getDeviceByID(old_dev.id, hidden=True)
                 if new_dev is None:
                     # if the device has been removed don't include this
                     # mountpoint at all
-- 
1.8.3.1



More information about the anaconda-patches mailing list