On Thu, May 23, 2013 at 05:00:02PM -0400, Chris Lumens wrote:
> diff --git a/pyanaconda/packaging/__init__.py
b/pyanaconda/packaging/__init__.py
> index 27de538..6376076 100644
> --- a/pyanaconda/packaging/__init__.py
> +++ b/pyanaconda/packaging/__init__.py
> @@ -374,7 +374,9 @@ class Payload(object):
> files = glob.glob(ROOT_PATH + "/boot/vmlinuz-*")
> files.extend(glob.glob(ROOT_PATH +
"/boot/efi/EFI/redhat/vmlinuz-*"))
> # strip off everything up to and including vmlinuz- to get versions
> - versions = [f.split("/")[-1][8:] for f in files if
os.path.isfile(f)]
> + # Ignore rescue kernels
> + versions = [f.split("/")[-1][8:] for f in files if
os.path.isfile(f) \
> + and f.find("-rescue-") == -1]
> versions.sort(cmp=cmpfunc)
> log.debug("kernel versions: %s" % versions)
> self._kernelVersionList = versions
While this is fine, I think the "find" bit is always a little hard to
read, when you could treat f like a list instead:
.. and "-rescue-" not in f]
Oh, hey, good idea. I'll do that instead.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)