From: Ondrej Lichtner <olichtne(a)redhat.com>
For some reason we never saved the cmd value provided during exception
initialization and haven't been using it as part of the exception string
message.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Common/ExecCmd.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lnst/Common/ExecCmd.py b/lnst/Common/ExecCmd.py
index 007acbd..c6c13b3 100644
--- a/lnst/Common/ExecCmd.py
+++ b/lnst/Common/ExecCmd.py
@@ -22,6 +22,7 @@ class ExecCmdFail(LnstError):
_report_stderr = None
def __init__(self, cmd=None, retval=None, outs=["", ""],
report_stderr=False):
+ self._cmd = cmd
self._stdout = outs[0]
self._stderr = outs[1]
self._retval = retval
@@ -43,7 +44,7 @@ def __str__(self):
retval = " (exited with %d)" % self._retval
if self._report_stderr:
stderr = " [%s]" % self._stderr
- return "Command execution failed%s%s" % (retval, stderr)
+ return "Command \"%s\" execution failed%s%s" % (self._cmd,
retval, stderr)
def log_output(log_func, out_type, out):
log_func("%s:\n"
--
2.21.0