correct parted return code p1.returncode
authorGui Chen <gui.chen@intel.com>
Fri, 13 Jan 2012 07:58:03 +0000 (15:58 +0800)
committerGui Chen <gui.chen@intel.com>
Fri, 13 Jan 2012 07:58:03 +0000 (15:58 +0800)
Signed-off-by: Gui Chen <gui.chen@intel.com>
mic/utils/partitionedfs.py

index a025cde..63abb0c 100644 (file)
@@ -169,7 +169,7 @@ class PartitionedMount(Mount):
                 # NOTE: We don't throw exception when return code is not 0, because
                 # parted always fails to reload part table with loop devices.
                 # This prevents us from distinguishing real errors based on return code.
-                msger.debug("WARNING: parted returned '%s' instead of 0 when creating partition-table for disk '%s'." % (p1.returncode,d['disk'].device))
+                msger.debug("WARNING: parted returned '%s' instead of 0 when creating partition-table for disk '%s'." % (rc, d['disk'].device))
 
         msger.debug("Creating partitions")
 
@@ -202,7 +202,7 @@ class PartitionedMount(Mount):
                 # NOTE: We don't throw exception when return code is not 0, because
                 # parted always fails to reload part table with loop devices.
                 # This prevents us from distinguishing real errors based on return code.
-                msger.debug("WARNING: parted returned '%s' instead of 0 when creating partition '%s' for disk '%s'." % (p1.returncode,p['mountpoint'],d['disk'].device))
+                msger.debug("WARNING: parted returned '%s' instead of 0 when creating partition '%s' for disk '%s'." % (ret, p['mountpoint'], d['disk'].device))
 
             if p['boot']:
                 msger.debug("Setting boot flag for partition '%s' on disk '%s'." % (p['num'],d['disk'].device))