Setup module tests

This commit is contained in:
Michael DeHaan 2012-04-04 11:55:24 -04:00
parent a3ac183861
commit cb46a14a96

7
setup
View file

@ -46,7 +46,7 @@ md5sum = None
if not os.path.exists(ansible_file):
changed = True
else:
md5sum = os.popen("md5sum %s" % ansible_file).read()
md5sum = os.popen("md5sum %s" % ansible_file).read().split()[0]
# if facter is installed, and we can use --json because
# ruby-json is ALSO installed, include facter data in the JSON
@ -91,14 +91,15 @@ reformat = json.dumps(new_options, sort_keys=True, indent=4)
f.write(reformat)
f.close()
md5sum2 = os.popen("md5sum %s" % ansible_file).read()
md5sum2 = os.popen("md5sum %s" % ansible_file).read().split()[0]
if md5sum != md5sum2:
changed = True
result = {
"written" : ansible_file,
"changed" : changed,
"md5sum" : md5sum
"md5sum" : md5sum2
}
print json.dumps(result)