[Pkg-escience-soc2009] [SCM] Tool for creating VM images. branch, master, updated. b82ac560ede9a3dcea843d34f865157b11cb3366

Steffen Moeller steffen_moeller at gmx.de
Sat Jun 20 15:38:30 UTC 2009


The following commit has been merged in the master branch:
commit b82ac560ede9a3dcea843d34f865157b11cb3366
Author: Steffen Moeller <steffen_moeller at gmx.de>
Date:   Sat Jun 20 17:37:15 2009 +0200

    Added check if partition was truly created.

diff --git a/VMBuilder/disk.py b/VMBuilder/disk.py
index 96040d3..53878bf 100644
--- a/VMBuilder/disk.py
+++ b/VMBuilder/disk.py
@@ -84,7 +84,10 @@ class Disk(object):
             if directory:
                 self.filename = '%s/%s' % (directory, self.filename)
             logging.info('Creating disk image: %s' % self.filename)
-            run_cmd(qemu_img_path(), 'create', '-f', 'raw', self.filename, '%dM' % self.size)
+            qemu_img_output = run_cmd(qemu_img_path(), 'create', '-f', 'raw', self.filename, '%dM' % self.size)
+            if not os.path.exists(self.filename): 
+                logging.info("Problem while creating raw image: %s" % qemu_img_output)
+                raise Exception("Problem while creating raw image: %s" % qemu_img_output)
 
         # From here, we assume that self.filename refers to whatever holds the disk image,
         # be it a file, a partition, logical volume, actual disk..

-- 
Tool for creating VM images.



More information about the Pkg-escience-soc2009 mailing list