mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Continued ans-command output upgrades, fixed output_dest back again
This commit is contained in:
parent
d6dcaefa9f
commit
b9b0240543
1 changed files with 10 additions and 3 deletions
|
@ -108,10 +108,17 @@ def main(args):
|
|||
hostname, rc, msg
|
||||
)
|
||||
else:
|
||||
print "%s | rc=%s >>" % (hostname, rc)
|
||||
print stdout
|
||||
buf = ''
|
||||
buf += "%s | rc=%s >>\n" % (hostname, rc)
|
||||
buf += stdout
|
||||
if stderr:
|
||||
print stderr
|
||||
buf += stderr
|
||||
print buf
|
||||
if options.output_dest:
|
||||
path = os.path.join(options.output_dest, hostname)
|
||||
fd = open(path, "w+")
|
||||
fd.write(buf)
|
||||
fd.close()
|
||||
|
||||
if results['dark']:
|
||||
error_print('Hosts which could not be contacted or did not respond:')
|
||||
|
|
Loading…
Reference in a new issue