From e86d17a13c26a57b8745b1951dace73ae6372de9 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Tue, 27 Jan 2009 20:09:08 -1000 Subject: 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. --- partIntfHelpers.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'partIntfHelpers.py') diff --git a/partIntfHelpers.py b/partIntfHelpers.py index f2338ded2..8dc195e36 100644 --- a/partIntfHelpers.py +++ b/partIntfHelpers.py @@ -382,7 +382,7 @@ def checkForSwapNoMatch(anaconda): part = parted.getPartitionByName(request.device) if (part and (not part.type & parted.PARTITION_FREESPACE) - and (part.get_flag(parted.LINUX_SWAP)) + and (part.getFlag(parted.PARTITION_SWAP)) and (request.fstype and request.fstype.getName() != "swap") and (not request.format)): rc = anaconda.intf.messageWindow(_("Format as Swap?"), @@ -393,15 +393,15 @@ def checkForSwapNoMatch(anaconda): "Would you like to format this " "partition as a swap partition?") % (request.device), type = "yesno", - custom_icon="question") + custom_icon="question") if rc == 1: request.format = 1 request.fstype = fsset.fileSystemTypeGet("swap") if request.fstype.getName() == "software RAID": - part.set_flag(parted.PARTITION_RAID, 1) + part.setFlag(parted.PARTITION_RAID) else: - part.set_flag(parted.PARTITION_RAID, 0) - + part.unsetFlag(parted.PARTITION_RAID) + partedUtils.set_partition_file_system_type(part, request.fstype) -- cgit