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

Merge pull request #7013 from orgoj/replace-patch-changed

module replace - report changed only if contents is changed
This commit is contained in:
James Cammarata 2014-05-08 15:14:19 -05:00
commit d9bb1a480a

View file

@ -139,7 +139,7 @@ def main():
mre = re.compile(params['regexp'], re.MULTILINE)
result = re.subn(mre, params['replace'], contents, 0)
if result[1] > 0:
if result[1] > 0 and contents != result[0]:
msg = '%s replacements made' % result[1]
changed = True
else: