From edb128900c2d05b8293c328997d627f270d15e49 Mon Sep 17 00:00:00 2001
From: Sapan Bhatia <gwsapan@gmail.com>
Date: Mon, 31 Mar 2014 18:42:34 -0400
Subject: [PATCH] Don't mount vservers partition if absent

---
 source/steps/ValidateNodeInstall.py | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

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
-- 
2.47.0