RHEL-3689: Print all arguments of failing command in err_msg
Improve error log by printing all arguments passed to command. This helps in troubleshooting issues where just knowing the command is not enough, we need more details on which settings, devices and options has caused this error. Signed-off-by: Kenneth D'souza <kennethdsouza94@gmail.com>
This commit is contained in:
parent
670541d273
commit
f7f9c0dedb
1 changed files with 2 additions and 2 deletions
|
|
@ -235,13 +235,13 @@ class commands:
|
|||
err_out = err[:-1]
|
||||
if len(err_out) == 0:
|
||||
err_out = out[:-1]
|
||||
err_msg = "Executing %s error: %s" % (args[0], err_out)
|
||||
err_msg = "Executing '%s' error: %s" % (' '.join(args), err_out)
|
||||
if not return_err:
|
||||
self._error(err_msg)
|
||||
except (OSError, IOError) as e:
|
||||
retcode = -e.errno if e.errno is not None else -1
|
||||
if not abs(retcode) in no_errors and not 0 in no_errors:
|
||||
err_msg = "Executing %s error: %s" % (args[0], e)
|
||||
err_msg = "Executing '%s' error: %s" % (' '.join(args), e)
|
||||
if not return_err:
|
||||
self._error(err_msg)
|
||||
if return_err:
|
||||
|
|
|
|||
Loading…
Reference in a new issue