mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Setup module tests
This commit is contained in:
parent
c71afe35d6
commit
cb5929dad7
2 changed files with 31 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue