We only gather data from stdout and stderr contents may confuse our parsing
code. But we may still be interested in the stderr so log it.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
blivet/util.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/blivet/util.py b/blivet/util.py
index a69b694..01a4548 100644
--- a/blivet/util.py
+++ b/blivet/util.py
@@ -44,15 +44,21 @@ def _run_program(argv, root='/', stdin=None, env_prune=None):
proc = subprocess.Popen(argv,
stdin=stdin,
stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT,
+ stderr=subprocess.PIPE,
close_fds=True,
preexec_fn=chroot, cwd=root, env=env)
- out = proc.communicate()[0]
+ out, err = proc.communicate()
if out:
+ program_log.info("stdout:")
for line in out.splitlines():
program_log.info("%s", line)
+ if err:
+ program_log.info("stderr:")
+ for line in err.splitlines():
+ program_log.info("%s", line)
+
except OSError as e:
program_log.error("Error running %s: %s", argv[0], e.strerror)
raise
--
1.9.3