module replace - report changed only if contents is changed
This commit is contained in:
parent
39356bd83b
commit
6618c1e8b5
1 changed files with 1 additions and 1 deletions
|
@ -139,7 +139,7 @@ def main():
|
||||||
mre = re.compile(params['regexp'], re.MULTILINE)
|
mre = re.compile(params['regexp'], re.MULTILINE)
|
||||||
result = re.subn(mre, params['replace'], contents, 0)
|
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]
|
msg = '%s replacements made' % result[1]
|
||||||
changed = True
|
changed = True
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue