[Pkg-libvirt-commits] [libvirt-sandbox] 18/42: virt-builder: check exit status of commands run

Guido Guenther agx at moszumanska.debian.org
Sat May 27 16:27:08 UTC 2017


This is an automated email from the git hooks/post-receive script.

agx pushed a commit to branch debian/experimental
in repository libvirt-sandbox.

commit df6c4bda4eb98cab116ef2dee6d0ed3e492b29f7
Author: Daniel P. Berrange <berrange at redhat.com>
Date:   Thu Jul 14 15:25:15 2016 +0100

    virt-builder: check exit status of commands run
    
    Currently if any command fails, the virt-builder source
    just carries on, with predictably bad results.
    
    Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
---
 libvirt-sandbox/image/sources/virtbuilder.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libvirt-sandbox/image/sources/virtbuilder.py b/libvirt-sandbox/image/sources/virtbuilder.py
index 6dfa6df..28fbffb 100644
--- a/libvirt-sandbox/image/sources/virtbuilder.py
+++ b/libvirt-sandbox/image/sources/virtbuilder.py
@@ -47,16 +47,16 @@ class VirtBuilderSource(base.Source):
         imagepath = "%s/%s.qcow2" % (templatedir, templatename)
         cmd = ["virt-builder", templatename,
                "-o", imagepath_original, "--format", "qcow2"]
-        subprocess.call(cmd)
+        subprocess.check_call(cmd)
 
         try:
             # We need to convert this image into a single partition one.
             tarfile = "%s/%s.tar" % (templatedir, templatename)
             cmd = ["virt-tar-out", "-a", imagepath_original, "/", tarfile]
-            subprocess.call(cmd)
+            subprocess.check_call(cmd)
 
             cmd = ["qemu-img", "create", "-q", "-f", "qcow2", imagepath, "10G"]
-            subprocess.call(cmd)
+            subprocess.check_call(cmd)
 
             self.format_disk(imagepath, "qcow2", connect)
             self.extract_tarball(imagepath, "qcow2", tarfile, connect)
@@ -81,7 +81,7 @@ class VirtBuilderSource(base.Source):
                "-f", "qcow2",
                "-o", "backing_fmt=qcow2,backing_file=%s" % diskfile,
                tempfile]
-        subprocess.call(cmd)
+        subprocess.check_call(cmd)
         return tempfile
 
     def get_env(self,template, templatedir):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libvirt-sandbox.git



More information about the Pkg-libvirt-commits mailing list