From: Sapan Bhatia Date: Mon, 31 Mar 2014 22:42:34 +0000 (-0400) Subject: Don't mount vservers partition if absent X-Git-Tag: bootmanager-5.2-5~1^2~22 X-Git-Url: http://git.onelab.eu/?p=bootmanager.git;a=commitdiff_plain;h=edb128900c2d05b8293c328997d627f270d15e49 Don't mount vservers partition if absent --- diff --git a/source/steps/ValidateNodeInstall.py b/source/steps/ValidateNodeInstall.py index 2f038ec..ea64a29 100644 --- a/source/steps/ValidateNodeInstall.py +++ b/source/steps/ValidateNodeInstall.py @@ -88,6 +88,7 @@ def Run( vars, log ): filesystems_tocheck = ['root', 'vservers'] else: filesystems_tocheck = ['root'] + for filesystem in filesystems_tocheck: try: # first run fsck to prevent fs corruption from hanging mount... @@ -124,17 +125,21 @@ def Run( vars, log ): log.write( "BootManagerException during mount of /proc: %s\n" % str(e) ) return -2 - try: - VSERVERS_PATH = "%s/vservers" % SYSIMG_PATH - utils.makedirs(VSERVERS_PATH) - log.write( "mounting vservers partition in root file system\n" ) - if vars['virt']=='vs': - utils.sysexec("mount -t ext3 %s %s" % (PARTITIONS["vservers"], VSERVERS_PATH), log) - else: - utils.sysexec("mount -t btrfs %s %s" % (PARTITIONS["vservers"], VSERVERS_PATH), log) - except BootManagerException, e: - log.write( "BootManagerException during mount of /vservers: %s\n" % str(e) ) - return -2 + + + one_partition = (ROOT_SIZE == "-1") + if (not one_partition): + try: + VSERVERS_PATH = "%s/vservers" % SYSIMG_PATH + utils.makedirs(VSERVERS_PATH) + log.write( "mounting vservers partition in root file system\n" ) + if vars['virt']=='vs': + utils.sysexec("mount -t ext3 %s %s" % (PARTITIONS["vservers"], VSERVERS_PATH), log) + else: + utils.sysexec("mount -t btrfs %s %s" % (PARTITIONS["vservers"], VSERVERS_PATH), log) + except BootManagerException, e: + log.write( "BootManagerException during mount of /vservers: %s\n" % str(e) ) + return -2 ROOT_MOUNTED= 1 vars['ROOT_MOUNTED']= 1