X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=source%2Fsteps%2FCheckForNewDisks.py;h=eedc5bb09fde5c823b02946b9fd329b968ac93da;hb=bf13ab792bb4091169a9681925bb53917d91d7bb;hp=1e368d58cb4b4d5bc9624b223a68472970f74eaf;hpb=094a91004df52c1db9cbdd65abe8bff6dbccd99c;p=bootmanager.git diff --git a/source/steps/CheckForNewDisks.py b/source/steps/CheckForNewDisks.py index 1e368d5..eedc5bb 100644 --- a/source/steps/CheckForNewDisks.py +++ b/source/steps/CheckForNewDisks.py @@ -1,5 +1,8 @@ #!/usr/bin/python - +# +# $Id$ +# $URL$ +# # Copyright (c) 2003 Intel Corporation # All rights reserved. # @@ -14,6 +17,8 @@ import systeminfo import utils import os +import ModelOptions + def Run( vars, log ): """ @@ -22,6 +27,7 @@ def Run( vars, log ): Expect the following variables to be set: SYSIMG_PATH the path where the system image will be mounted MINIMUM_DISK_SIZE any disks smaller than this size, in GB, are not used + NODE_MODEL_OPTIONS the node's model options Set the following variables upon successfully running: ROOT_MOUNTED the node root file system is mounted @@ -41,6 +47,7 @@ def Run( vars, log ): if PARTITIONS == None: raise ValueError, "PARTITIONS" + NODE_MODEL_OPTIONS= vars["NODE_MODEL_OPTIONS"] except KeyError, var: raise BootManagerException, "Missing variable in vars: %s\n" % var except ValueError, var: @@ -96,16 +103,21 @@ def Run( vars, log ): log.write("To paranoid to add %s to vservers lvm.\n" % device) continue - log.write( "Attempting to add %s to the volume group\n" % device ) - if not InstallPartitionDisks.single_partition_device( device, vars, log ): log.write( "Unable to partition %s, not using it.\n" % device ) continue - log.write( "Successfully initialized %s\n" % device ) + log.write( "Successfully partitioned %s\n" % device ) + + if NODE_MODEL_OPTIONS & ModelOptions.RAWDISK: + log.write( "Running on a raw disk node, not using it.\n" ) + continue part_path= InstallPartitionDisks.get_partition_path_from_device( device, vars, log ) + + log.write( "Attempting to add %s to the volume group\n" % device ) + if not InstallPartitionDisks.create_lvm_physical_volume( part_path, vars, log ): log.write( "Unable to create lvm physical volume %s, not using it.\n" % @@ -127,7 +139,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 @@ -160,7 +172,7 @@ def Run( vars, log ): res = 1 break - log.write( "making the ext3 filesystem match new logical volume size.\n" ) + log.write( "making the ext filesystem match new logical volume size.\n" ) vars['ROOT_MOUNTED']= 1 cmd = "mount %s %s" % (PARTITIONS["root"],SYSIMG_PATH)