diff options
author | Chris Lumens <clumens@redhat.com> | 2007-07-13 14:20:57 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2007-07-13 14:20:57 +0000 |
commit | 192e81e0296a88548ae4a83bba6dfb389c2840e1 (patch) | |
tree | 0fe5697df64f2d067646ec5501bcee633e38ca97 /partedUtils.py | |
parent | d02e2b8b9f23dd43b9d895ff34f8f562b68102af (diff) | |
download | anaconda-192e81e0296a88548ae4a83bba6dfb389c2840e1.tar.gz anaconda-192e81e0296a88548ae4a83bba6dfb389c2840e1.tar.xz anaconda-192e81e0296a88548ae4a83bba6dfb389c2840e1.zip |
Don't read filesystem labels from drives in the cleared list to avoid reserving
labels that won't exist after partitioning is complete (#209291).
Diffstat (limited to 'partedUtils.py')
-rw-r--r-- | partedUtils.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/partedUtils.py b/partedUtils.py index 7ae78e3c3..5f0b46142 100644 --- a/partedUtils.py +++ b/partedUtils.py @@ -6,7 +6,7 @@ # Mike Fulbright <msf@redhat.com> # Karsten Hopp <karsten@redhat.com> # -# Copyright 2002-2003 Red Hat, Inc. +# Copyright 2002-2007 Red Hat, Inc. # # This software may be freely redistributed under the terms of the GNU # library public license. @@ -575,6 +575,8 @@ class DiskSet: skippedDisks = [] mdList = [] + clearedDisks = [] + dmList = None mpList = None @@ -684,11 +686,17 @@ class DiskSet: def getLabels(self): """Return a list of all of the labels used on partitions.""" labels = {} - + drives = self.disks.keys() drives.sort() for drive in drives: + # Don't read labels from drives we cleared using clearpart, as + # we don't actually remove the existing filesystems so those + # labels will still be present (#209291). + if drive in DiskSet.clearedDisks: + continue + disk = self.disks[drive] func = lambda part: (part.is_active() and not (part.get_flag(parted.PARTITION_RAID) @@ -1018,6 +1026,7 @@ class DiskSet: try: disk = dev.disk_new_fresh(getDefaultDiskType()) disk.commit() + DiskSet.clearedDisks.append(drive) del disk del dev except parted.error, msg: @@ -1146,6 +1155,7 @@ class DiskSet: try: disk = dev.disk_new_fresh(getDefaultDiskType()) disk.commit() + DiskSet.clearedDisks.append(drive) except parted.error, msg: DiskSet.skippedDisks.append(drive) continue @@ -1202,6 +1212,7 @@ class DiskSet: try: disk = dev.disk_new_fresh(getDefaultDiskType()) disk.commit() + DiskSet.clearedDisks.append(drive) except parted.error, msg: DiskSet.skippedDisks.append(drive) continue |