From: Sapan Bhatia Date: Tue, 1 Apr 2014 02:18:03 +0000 (-0400) Subject: Support kernel check other than rpm X-Git-Tag: bootmanager-5.2-5~1^2~17 X-Git-Url: http://git.onelab.eu/?p=bootmanager.git;a=commitdiff_plain;h=22a4de46644673c2cdac84adb2da900020e657d6 Support kernel check other than rpm --- diff --git a/source/steps/ValidateNodeInstall.py b/source/steps/ValidateNodeInstall.py index bd42f00..111ba26 100644 --- a/source/steps/ValidateNodeInstall.py +++ b/source/steps/ValidateNodeInstall.py @@ -151,8 +151,12 @@ def Run( vars, log ): if vars['virt'] == 'vs': os.stat("%s/boot/kernel-boot" % SYSIMG_PATH) else: - kversion = os.popen("chroot %s rpm -qa kernel | tail -1 | cut -c 8-" % SYSIMG_PATH).read().rstrip() - os.stat("%s/boot/vmlinuz-%s" % (SYSIMG_PATH,kversion)) + try: + kversion = os.popen("chroot %s rpm -qa kernel | tail -1 | cut -c 8-" % SYSIMG_PATH).read().rstrip() + os.stat("%s/boot/vmlinuz-%s" % (SYSIMG_PATH,kversion)) + major_version = int(kversion[0]) # Check if the string looks like a kernel version + except: + kversion = os.popen("ls -lrt /lib/modules | tail -1 | awk '{print $9;}'").read().rstrip() except OSError, e: log.write( "Couldn't locate base kernel (you might be using the stock kernel).\n") return -3