RoleRequirement - Include stderr in the error message (#66006)
* RoleRequirement - Include stderr in the error message if there's a non-0 return code * Don't try to concatenate str and bytes Co-Authored-By: Sam Doran <sdoran@redhat.com>
This commit is contained in:
parent
b06e78c16c
commit
1b3ca349eb
2 changed files with 5 additions and 3 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- RoleRequirement - include stderr in the error message if a scm command fails (https://github.com/ansible/ansible/issues/41336)
|
|
@ -145,11 +145,11 @@ class RoleRequirement(RoleDefinition):
|
|||
except Exception as e:
|
||||
ran = " ".join(cmd)
|
||||
display.debug("ran %s:" % ran)
|
||||
display.debug("\tstdout: " + stdout)
|
||||
display.debug("\tstderr: " + stderr)
|
||||
display.debug("\tstdout: " + to_text(stdout))
|
||||
display.debug("\tstderr: " + to_text(stderr))
|
||||
raise AnsibleError("when executing %s: %s" % (ran, to_native(e)))
|
||||
if popen.returncode != 0:
|
||||
raise AnsibleError("- command %s failed in directory %s (rc=%s)" % (' '.join(cmd), tempdir, popen.returncode))
|
||||
raise AnsibleError("- command %s failed in directory %s (rc=%s) - %s" % (' '.join(cmd), tempdir, popen.returncode, to_native(stderr)))
|
||||
|
||||
if scm not in ['hg', 'git']:
|
||||
raise AnsibleError("- scm %s is not currently supported" % scm)
|
||||
|
|
Loading…
Reference in a new issue