From 9c656e7b45e4f9be16f8992e69aad26c39068090 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Thu, 21 Jun 2012 14:18:04 -0700 Subject: Fix handling of invalid bios disks (#819721) --- pyanaconda/kickstart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pyanaconda/kickstart.py') diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index 5888e4fd1..6692577e7 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -840,7 +840,7 @@ class PartitionData(commands.partition.F17_PartData): self.disk = disk break - if self.disk == "": + if not self.disk: raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified BIOS disk %s cannot be determined" % self.onbiosdisk) if self.mountpoint == "swap": -- cgit From 08440435d06deb3940b5f59ce275df3e74c76269 Mon Sep 17 00:00:00 2001 From: Vratislav Podzimek Date: Fri, 20 Apr 2012 11:42:42 +0200 Subject: Move swapSuggestion to storage and use a new suggested algorithm for it We were using an algorithm that suggested the swap size as 2 GB + size of RAM, but this resulted in huge swaps on machines with a lot of RAM. The new algorithm comes from the discussion with other teams. (ported 84b3444a277b73abeaddf7d4b186a79569eb56d2 from rhel6-branch) (ported 37415063594d00c896ff3c50496582f0c4e9e3d9 from rhel6-branch) --- pyanaconda/kickstart.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'pyanaconda/kickstart.py') diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index 6692577e7..00dc0b8d3 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -25,6 +25,7 @@ from storage.devicelibs.mpath import MultipathConfigWriter, MultipathTopology from storage.formats import getFormat from storage.partitioning import clearPartitions from storage.partitioning import shouldClear +from storage.devicelibs import swap import storage.iscsi import storage.fcoe import storage.zfcp @@ -540,9 +541,9 @@ class LogVolData(commands.logvol.F17_LogVolData): if self.mountpoint == "swap": type = "swap" self.mountpoint = "" - if self.recommended: - (self.size, self.maxSizeMB) = iutil.swapSuggestion() - self.grow = True + if self.recommended or self.hibernation: + self.size = swap.swapSuggestion(hibernation=self.hibernation) + self.grow = False else: if self.fstype != "": type = self.fstype @@ -846,9 +847,9 @@ class PartitionData(commands.partition.F17_PartData): if self.mountpoint == "swap": type = "swap" self.mountpoint = "" - if self.recommended: - (self.size, self.maxSizeMB) = iutil.swapSuggestion() - self.grow = True + if self.recommended or self.hibernation: + self.size = swap.swapSuggestion(hibernation=self.hibernation) + self.grow = False # if people want to specify no mountpoint for some reason, let them # this is really needed for pSeries boot partitions :( elif self.mountpoint == "None": -- cgit From 914115356ae58b3abcf884a05d92b8cda3ab41ad Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 26 Jun 2012 11:40:15 -0700 Subject: Let kickstart users log to device nodes (#835563) If a kickstart pre/post fails we read the logfile and add it to the anaconda log. This doesn't work well for device nodes like /dev/console so skip reading the log it isn't a regular file. Resolves: rhbz#835563 --- pyanaconda/kickstart.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'pyanaconda/kickstart.py') diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index 00dc0b8d3..9be680d7c 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -112,15 +112,16 @@ class AnacondaKSScript(Script): if rc != 0: log.error("Error code %s running the kickstart script at line %s" % (rc, self.lineno)) - try: - f = open(messages, "r") - except IOError as e: - err = None - else: - err = f.readlines() - f.close() - for l in err: - log.error("\t%s" % l) + if os.path.isfile(messages): + try: + f = open(messages, "r") + except IOError as e: + err = None + else: + err = f.readlines() + f.close() + for l in err: + log.error("\t%s" % l) if self.errorOnFail: if intf != None: -- cgit