[PATCH 08/21] Fix DiskLabel so it can be deep-copied.

David Lehman dlehman at redhat.com
Thu Aug 9 19:28:27 UTC 2012


---
 pyanaconda/storage/formats/disklabel.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/storage/formats/disklabel.py b/pyanaconda/storage/formats/disklabel.py
index 338a880..87dbea2 100644
--- a/pyanaconda/storage/formats/disklabel.py
+++ b/pyanaconda/storage/formats/disklabel.py
@@ -85,10 +85,13 @@ class DiskLabel(DeviceFormat):
         """
         new = self.__class__.__new__(self.__class__)
         memo[id(self)] = new
-        shallow_copy_attrs = ('_partedDevice', '_partedDisk', '_origPartedDisk')
+        shallow_copy_attrs = ('_partedDevice', '_alignment', '_endAlignment')
+        duplicate_attrs = ('_partedDisk', '_origPartedDisk')
         for (attr, value) in self.__dict__.items():
             if attr in shallow_copy_attrs:
                 setattr(new, attr, copy.copy(value))
+            elif attr in duplicate_attrs:
+                setattr(new, attr, value.duplicate())
             else:
                 setattr(new, attr, copy.deepcopy(value, memo))
 
-- 
1.7.7.6



More information about the anaconda-patches mailing list