mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Initial crack at the file module
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user