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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]