[PATCH] Update parted partitions on hidden disks when copying a Blivet. (#1023556)

David Lehman dlehman at redhat.com
Fri Oct 25 22:14:29 UTC 2013


---
 blivet/__init__.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/blivet/__init__.py b/blivet/__init__.py
index 0aa4897..731482b 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -1925,11 +1925,13 @@ class Blivet(object):
         new = copy.deepcopy(self)
         # go through and re-get partedPartitions from the disks since they
         # don't get deep-copied
-        for partition in new.partitions:
+        hidden_partitions = [d for d in new.devicetree._hidden
+                                if isinstance(d, PartitionDevice)]
+        for partition in new.partitions + hidden_partitions:
             if not partition._partedPartition:
                 continue
 
-            # don't ask me why, but we have to update the refs in req_disks
+            # update the refs in req_disks as well
             req_disks = []
             for disk in partition.req_disks:
                 req_disks.append(new.devicetree.getDeviceByID(disk.id))
-- 
1.8.1.4



More information about the anaconda-patches mailing list