do not check for initrd in Validate, since it is recreated later.
authorStephen Soltesz <soltesz@cs.princeton.edu>
Mon, 10 Aug 2009 17:24:19 +0000 (17:24 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Mon, 10 Aug 2009 17:24:19 +0000 (17:24 +0000)
catch the error if removing initrd fails in MakeInitrd, since it's about to
recreate it anyway.

In combination this patch avoids the situation where initrd is missing but BM
fails.  Now, if initrd is missing, BM will proceed and recreate it without
error.

source/steps/MakeInitrd.py
source/steps/ValidateNodeInstall.py

index 3abbd73..bf1ba95 100644 (file)
@@ -67,7 +67,11 @@ def Run( vars, log ):
     utils.sysexec("mount -t sysfs none %s/sys" % SYSIMG_PATH)
 
     initrd, kernel_version= systeminfo.getKernelVersion(vars,log)
-    utils.removefile( "%s/boot/%s" % (SYSIMG_PATH, initrd) )
+    try:
+        utils.removefile( "%s/boot/%s" % (SYSIMG_PATH, initrd) )
+    except:
+        print "%s/boot/%s is already removed" % (SYSIMG_PATH, initrd) )
+
     # hack for CentOS 5.3
     bypassRaidIfNeeded(SYSIMG_PATH)
     if kernelHasMkinitrd() == True:
index 845348a..c70aad9 100644 (file)
@@ -18,7 +18,7 @@ def Run( vars, log ):
     """
     See if a node installation is valid. More checks should certainly be
     done in the future, but for now, make sure that the sym links kernel-boot
-    and initrd-boot exist in /boot
+    exist in /boot
     
     Expect the following variables to be set:
     SYSIMG_PATH              the path where the system image will be mounted
@@ -123,7 +123,6 @@ def Run( vars, log ):
     log.write("Checking for a custom kernel\n")
     try:
         os.stat("%s/boot/kernel-boot" % SYSIMG_PATH)
-        os.stat("%s/boot/initrd-boot" % SYSIMG_PATH)
     except OSError, e:            
         log.write( "Couldn't locate base kernel (you might be using the stock kernel).\n")
         return -3
@@ -134,7 +133,6 @@ def Run( vars, log ):
         option = 'smp'
         try:
             os.stat("%s/boot/kernel-boot%s" % (SYSIMG_PATH,option))
-            os.stat("%s/boot/initrd-boot%s" % (SYSIMG_PATH,option))
         except OSError, e:
             # smp kernel is not there; remove option from modeloptions
             # such that the rest of the code base thinks we are just