From 22a4de46644673c2cdac84adb2da900020e657d6 Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Mon, 31 Mar 2014 22:18:03 -0400 Subject: [PATCH] Support kernel check other than rpm --- source/steps/ValidateNodeInstall.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 2.43.0