[libvirt] [PATCH sandbox 08/24] image: check for errors running mkfs / virt-sandbox

Daniel P. Berrange berrange at redhat.com
Fri Jul 15 13:08:00 UTC 2016


When running the sandbox commands, use check_call() instead
of call() so that we detect errors running external commands.

Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
---
 libvirt-sandbox/image/sources/base.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libvirt-sandbox/image/sources/base.py b/libvirt-sandbox/image/sources/base.py
index 8f6ccba..f70551d 100644
--- a/libvirt-sandbox/image/sources/base.py
+++ b/libvirt-sandbox/image/sources/base.py
@@ -128,7 +128,7 @@ class Source():
                   '/sbin/mkfs.ext3',
                   '/dev/disk/by-tag/disk_image']
         cmd = cmd + params
-        subprocess.call(cmd)
+        subprocess.check_call(cmd)
 
     def extract_tarball(self, diskfile, format, tarfile, connect):
         cmd = ['virt-sandbox']
@@ -148,4 +148,4 @@ class Source():
                   '-C',
                   '/mnt']
         cmd = cmd + params
-        subprocess.call(cmd)
+        subprocess.check_call(cmd)
-- 
2.7.4




More information about the libvir-list mailing list