add debug messages about the status of partitions
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 25 Jun 2015 21:02:03 +0000 (23:02 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 25 Jun 2015 21:02:03 +0000 (23:02 +0200)
source/steps/ChainBootNode.py
source/steps/CheckForNewDisks.py
source/steps/InstallBootstrapFS.py
source/steps/InstallPartitionDisks.py
source/utils.py

index 820aa7d..982a6de 100644 (file)
@@ -95,6 +95,8 @@ def Run(vars, log):
         ROOT_MOUNTED = 1
         vars['ROOT_MOUNTED'] = 1
 
+    utils.display_disks_status(PARTITIONS, "In ChainBootNode", log)
+
     # write out the session value /etc/planetlab/session
     try:
         session_file_path = "{}/{}/session".format(SYSIMG_PATH, PLCONF_DIR)
index 38d8464..42a07e7 100644 (file)
@@ -58,6 +58,8 @@ def Run(vars, log):
     # total amount of new space in gb
     extended_gb_size = 0
     
+    utils.display_disks_status(PARTITIONS, "In CheckForNewDisks", log)
+
     for device, details in devices_dict.items():
 
         (major, minor, blocks, gb_size, readonly) = details
index 7449b2c..c0f27cb 100644 (file)
@@ -87,13 +87,9 @@ def Run(vars, upgrade, log):
         utils.sysexec_noerr("vgscan --mknodes", log)
 
     # debugging info - show in either mode
-    log.write("In InstallBootstrapFS : DEVICES status BEG\n")
-    utils.sysexec_noerr("vgdisplay", log)
-    utils.sysexec_noerr("pvdisplay", log)
-    for name, path in PARTITIONS.items():
-        log.write("PARTITIONS[{}]={}\n".format(name,path))
-        utils.sysexec_noerr("ls -l {}".format(path), log)
-    log.write("In InstallBootstrapFS : DEVICES status END\n")
+    utils.display_disks_status(PARTITIONS, "In InstallBootstrapFS", log)
+
+    utils.breakpoint("we need to make /dev/mapper/* appear")
 
     log.write("turning on swap space\n")
     utils.sysexec("swapon {}".format(PARTITIONS["swap"]), log)
index d0df2f2..dd9a3f0 100644 (file)
@@ -199,6 +199,8 @@ def Run(vars, log):
     # list of block devices used may be updated
     vars["INSTALL_BLOCK_DEVICES"] = used_devices
 
+    utils.display_disks_status(PARTITIONS, "End of InstallPartitionDisks", log)
+
     return 1
 
 
index e0f3c72..8f8b0bd 100644 (file)
@@ -313,3 +313,12 @@ def sha1_file(filename):
         return m.hexdigest()
     except IOError:
         raise BootManagerException("Cannot calculate SHA1 hash of {}".format(filename))
+
+def display_disks_status(PARTITIONS, message, log):
+    log.write("{} - PARTITIONS status - BEG\n".format(message))
+    sysexec_noerr("vgdisplay", log)
+    sysexec_noerr("pvdisplay", log)
+    for name, path in PARTITIONS.items():
+        log.write("PARTITIONS[{}]={}\n".format(name,path))
+        sysexec_noerr("ls -l {}".format(path), log)
+    log.write("{} - PARTITIONS status - END\n".format(message))