git://git.onelab.eu
/
bootmanager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7cc4455
)
Support kernel check other than rpm
author
Sapan Bhatia
<gwsapan@gmail.com>
Tue, 1 Apr 2014 02:18:03 +0000
(22:18 -0400)
committer
Sapan Bhatia
<gwsapan@gmail.com>
Tue, 1 Apr 2014 02:18:03 +0000
(22:18 -0400)
source/steps/ValidateNodeInstall.py
patch
|
blob
|
history
diff --git
a/source/steps/ValidateNodeInstall.py
b/source/steps/ValidateNodeInstall.py
index
bd42f00
..
111ba26
100644
(file)
--- 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:
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
except OSError, e:
log.write( "Couldn't locate base kernel (you might be using the stock kernel).\n")
return -3