diff options
author | David Cantrell <dcantrell@redhat.com> | 2009-01-27 20:09:08 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2009-02-12 11:30:03 -1000 |
commit | e86d17a13c26a57b8745b1951dace73ae6372de9 (patch) | |
tree | 1d40a1879386ccf8e33673a8ec512e02affb79f6 /bootloader.py | |
parent | 6926d406cdd73b9da40e9c4a4e4b740b4566736d (diff) | |
download | anaconda-e86d17a13c26a57b8745b1951dace73ae6372de9.tar.gz anaconda-e86d17a13c26a57b8745b1951dace73ae6372de9.tar.xz anaconda-e86d17a13c26a57b8745b1951dace73ae6372de9.zip |
Syntax changes for the new pyparted.
1) Iterate over partitions with a for loop over
disk.partitions.values() rather than calling next_partition()
2) Call getFlag() rather than get_flag()
3) Call setFlag() to enable a flag, call unsetFlag() to disable
a flag.
4) Reference the active property rather than calling the
is_active() method.
And other fixes.
Diffstat (limited to 'bootloader.py')
-rw-r--r-- | bootloader.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/bootloader.py b/bootloader.py index eedd64211..301a8dd0c 100644 --- a/bootloader.py +++ b/bootloader.py @@ -65,12 +65,10 @@ def bootloaderSetupChoices(anaconda): bootPart = None for drive in drives: disk = anaconda.id.diskset.disks[drive] - part = disk.next_partition() - while part: - if part.is_active() and partedUtils.isEfiSystemPartition(part): + for part in disk.partitions.values(): + if part.active and partedUtils.isEfiSystemPartition(part): bootPart = part.getDeviceNodeName() break - part = disk.next_partition(part) if bootPart: break if bootPart: @@ -80,18 +78,16 @@ def bootloaderSetupChoices(anaconda): anaconda.id.fsset.add(FileSystemSetEntry(dev, None, fileSystemTypeGet("efi"))) # iSeries bootloader on upgrades - if iutil.getPPCMachine() == "iSeries" and not anaconda.id.bootloader.device: + if iutil.getPPCMachine() == "iSeries" and not anaconda.id.bootloader.device: drives = anaconda.id.diskset.disks.keys() drives.sort() bootPart = None for drive in drives: disk = anaconda.id.diskset.disks[drive] - part = disk.next_partition() - while part: - if part.is_active() and part.get_flag(parted.PARTITION_PREP): + for part in disk.partitions.values(): + if part.active and part.getFlag(parted.PARTITION_PREP): bootPart = part.getDeviceNodeName() break - part = disk.next_partition(part) if bootPart: break if bootPart: |