From a1706e6411cad4bf003d1966018801ff3a954921 Mon Sep 17 00:00:00 2001 From: Michael Heca Date: Tue, 15 Apr 2014 14:50:34 +0200 Subject: [PATCH] module replace - report changed only if contents is changed --- library/files/replace | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/files/replace b/library/files/replace index f4193ae9f30..536ac8cd8fc 100644 --- a/library/files/replace +++ b/library/files/replace @@ -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: