1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Do not mark "skipped" when changed is false

When using the "creates" option with the uri module, set changed
to False if the file already exists. This behavior is consistent with
other modules which use "creates", such as command and shell.
This commit is contained in:
Dan Rue 2015-02-17 15:19:22 -06:00 committed by Matt Clay
parent 8e4755728e
commit d3c686d632

View file

@ -381,7 +381,7 @@ def main():
# of uri executions.
creates = os.path.expanduser(creates)
if os.path.exists(creates):
module.exit_json(stdout="skipped, since %s exists" % creates, skipped=True, changed=False, stderr=False, rc=0)
module.exit_json(stdout="skipped, since %s exists" % creates, changed=False, stderr=False, rc=0)
if removes is not None:
# do not run the command if the line contains removes=filename
@ -389,7 +389,7 @@ def main():
# of uri executions.
v = os.path.expanduser(removes)
if not os.path.exists(removes):
module.exit_json(stdout="skipped, since %s does not exist" % removes, skipped=True, changed=False, stderr=False, rc=0)
module.exit_json(stdout="skipped, since %s does not exist" % removes, changed=False, stderr=False, rc=0)
# httplib2 only sends authentication after the server asks for it with a 401.