summaryrefslogtreecommitdiffstats
path: root/bootloader.py
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2009-01-27 19:34:43 -1000
committerDavid Cantrell <dcantrell@redhat.com>2009-02-12 11:30:30 -1000
commit55045db98356d6272f9e482dfed2fd880d47ddda (patch)
treeb8b32f32f746ebdc125661ba1082512c863f4325 /bootloader.py
parent7b6941f5c58f1ee7063ef9eb88795d6d1a44733a (diff)
downloadanaconda-55045db98356d6272f9e482dfed2fd880d47ddda.tar.gz
anaconda-55045db98356d6272f9e482dfed2fd880d47ddda.tar.xz
anaconda-55045db98356d6272f9e482dfed2fd880d47ddda.zip
Iterate over partitions using disk.partitions
Rather than calling disk.nextPartition() over and over, we can get a hash table of all partitions on a disk via disk.partitions. Iterate over the values() of this hash (the keys correspond to the partition number).
Diffstat (limited to 'bootloader.py')
-rw-r--r--bootloader.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bootloader.py b/bootloader.py
index 39102fedf..58d20b39d 100644
--- a/bootloader.py
+++ b/bootloader.py
@@ -65,7 +65,7 @@ def bootloaderSetupChoices(anaconda):
bootPart = None
for drive in drives:
disk = anaconda.id.diskset.disks[drive]
- for part in disk.partitions.values():
+ for part in disk.partitions:
if part.active and partedUtils.isEfiSystemPartition(part):
bootPart = part.getDeviceNodeName()
break
@@ -84,7 +84,7 @@ def bootloaderSetupChoices(anaconda):
bootPart = None
for drive in drives:
disk = anaconda.id.diskset.disks[drive]
- for part in disk.partitions.values():
+ for part in disk.partitions:
if part.active and part.getFlag(parted.PARTITION_PREP):
bootPart = part.getDeviceNodeName()
break