[lorax 1/2] Log the output of mkfs (#769928)

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

 



---
 src/pylorax/imgutils.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/pylorax/imgutils.py b/src/pylorax/imgutils.py
index db344e0..fa84234 100644
--- a/src/pylorax/imgutils.py
+++ b/src/pylorax/imgutils.py
@@ -24,6 +24,7 @@ import os, tempfile
 from os.path import join, dirname
 from pylorax.sysutils import cpfile
 from subprocess import *
+import sys
 import traceback
 
 ######## Functions for making container images (cpio, squashfs) ##########
@@ -267,8 +268,13 @@ def mkfsimage(fstype, rootdir, outfile, size=None, mkfsargs=[], mountargs="", gr
     if not size:
         size = estimate_size(rootdir, graft, fstype)
     with LoopDev(outfile, size) as loopdev:
-        check_call(["mkfs.%s" % fstype] + mkfsargs + [loopdev],
-                   stdout=PIPE, stderr=PIPE)
+        try:
+            check_output(["mkfs.%s" % fstype] + mkfsargs + [loopdev])
+        except CalledProcessError as e:
+            logger.error("mkfs exited with a non-zero return code: %d" % e.returncode)
+            logger.error(e.output)
+            sys.exit(e.returncode)
+
         with Mount(loopdev, mountargs) as mnt:
             if rootdir:
                 copytree(rootdir, mnt, preserve)
-- 
1.7.5.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux