Merge pull request #23350 from lorengordon/file.replace_assume_line

Append/prepend: search for full line
This commit is contained in:
Justin Findlay 2015-05-05 15:42:11 -06:00
commit 3493cc1fca

View file

@ -1152,7 +1152,7 @@ def replace(path,
if prepend_if_not_found or append_if_not_found:
# Search for content, so we don't continue pre/appending
# the content if it's been pre/appended in a previous run.
if re.search(content, line):
if re.search('^{0}$'.format(content), line):
# Content was found, so set found.
found = True