X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=source%2Fsteps%2FInstallInit.py;h=c609818a9a98d8b036791aef33d5543a89138051;hb=05fcdf2237fe6100cc31828ca206d42b24e8ae5a;hp=70aa994ee0791934a86b60a423f4980443523150;hpb=ae73c450bffe036dccf37e8d96a4b655c3cd900e;p=bootmanager.git diff --git a/source/steps/InstallInit.py b/source/steps/InstallInit.py index 70aa994..c609818 100644 --- a/source/steps/InstallInit.py +++ b/source/steps/InstallInit.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/python # Copyright (c) 2003 Intel Corporation # All rights reserved. @@ -7,11 +7,10 @@ # All rights reserved. # expected /proc/partitions format -import os, sys, shutil -import string +import os, sys, string import utils - +from Exceptions import * def Run( vars, log ): """ @@ -61,7 +60,7 @@ def Run( vars, log ): try: # backwards compat, though, we should never hit this case post PL 3.2 os.stat("%s/rcfs/taskclass"%SYSIMG_PATH) - utils.sysexec_noerr( "chroot %s umount /rcfs" % SYSIMG_PATH, log ) + utils.sysexec_chroot_noerr( SYSIMG_PATH, "umount /rcfs", log ) except OSError, e: pass @@ -71,11 +70,16 @@ def Run( vars, log ): utils.sysexec_noerr( "umount %s" % SYSIMG_PATH ) vars['ROOT_MOUNTED']= 0 - log.write( "Removing any old files, directories\n" ) - utils.removedir( TEMP_PATH ) +# log.write( "Removing any old files, directories\n" ) +# utils.removedir( TEMP_PATH ) log.write( "Cleaning up any existing PlanetLab config files\n" ) - utils.removedir( PLCONF_DIR ) + try: + flist = os.listdir( PLCONF_DIR) + for file in flist: + utils.removedir( file ) + except OSError: + pass # create the temp path and sysimg path. since sysimg # path is in temp path, both are created here