-#!/usr/bin/python2
-
+#!/usr/bin/python
+#
# Copyright (c) 2003 Intel Corporation
# All rights reserved.
#
# 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 ):
"""
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
- utils.sysexec_noerr( "umount %s/proc" % SYSIMG_PATH )
- utils.sysexec_noerr( "umount %s/mnt/cdrom" % SYSIMG_PATH )
- utils.sysexec_noerr( "umount %s/vservers" % SYSIMG_PATH )
- utils.sysexec_noerr( "umount %s" % SYSIMG_PATH )
+ # NOTE: added /sys and /dev b/c some nodes fail due to this when disk is
+ # nearly full.
+ utils.sysexec_noerr( "umount %s/proc" % SYSIMG_PATH , log )
+ utils.sysexec_noerr( "umount %s/mnt/cdrom" % SYSIMG_PATH , log )
+ utils.sysexec_noerr( "umount %s/vservers" % SYSIMG_PATH , log )
+ utils.sysexec_noerr( "umount %s/sys" % SYSIMG_PATH , log )
+ utils.sysexec_noerr( "umount %s/dev" % SYSIMG_PATH , log )
+ utils.sysexec_noerr( "umount %s" % SYSIMG_PATH , log )
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