svn merge -c 9766 https://svn.planet-lab.org/svn/BootManager/branches/3.2 into trunk
[bootmanager.git] / source / steps / InstallInit.py
index 70aa994..c609818 100644 (file)
@@ -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