mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-06-29 23:49:09 +00:00
Initial crack at the file module
This commit is contained in:
parent
8914a1a0d7
commit
be55145a1e
3 changed files with 237 additions and 5 deletions
|
|
@ -61,16 +61,27 @@ cmd = subprocess.Popen("%s %s" % (modfile, argspath),
|
|||
stderr=subprocess.PIPE)
|
||||
(out, err) = cmd.communicate()
|
||||
|
||||
if err and err != '':
|
||||
print "***********************************"
|
||||
print "RECIEVED DATA ON STDOUT, WILL IGNORE THIS:"
|
||||
print err
|
||||
|
||||
try:
|
||||
results = ansible.utils.parse_json(out)
|
||||
except:
|
||||
print "INVALID OUTPUT FORMAT"
|
||||
print "*********************"
|
||||
print "***********************************"
|
||||
print "RAW OUTPUT"
|
||||
print out
|
||||
results = ansible.utils.parse_json(out)
|
||||
|
||||
except:
|
||||
print "***********************************"
|
||||
print "INVALID OUTPUT FORMAT"
|
||||
print out
|
||||
print "*********************"
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
|
||||
print "***********************************"
|
||||
print "PARSED OUTPUT"
|
||||
|
||||
print results
|
||||
|
||||
sys.exit(0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue