commands: if there is no stderr output of failed command, show stdout
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
f47af4d4cc
commit
cc4d90d42e
1 changed files with 4 additions and 1 deletions
|
|
@ -44,7 +44,10 @@ def execute(args):
|
|||
out, err = proc.communicate()
|
||||
|
||||
if proc.returncode:
|
||||
log.error("Executing %s error: %s" % (args[0], err[:-1]))
|
||||
err_out = err[:-1]
|
||||
if len(err_out) == 0:
|
||||
err_out = out[:-1]
|
||||
log.error("Executing %s error: %s" % (args[0], err_out))
|
||||
except (OSError,IOError) as e:
|
||||
log.error("Executing %s error: %s" % (args[0], e))
|
||||
return out
|
||||
|
|
|
|||
Loading…
Reference in a new issue