[38451] Fix few bugs after review

This commit is contained in:
Alexey Aksenov 2017-01-18 13:51:42 +03:00
parent 1bdab253ad
commit 81f0337338

View file

@ -2015,7 +2015,7 @@ def replace(path,
found = False
temp_file = None
content = str(not_found_content) if not_found_content and \
content = salt.utils.to_str(not_found_content) if not_found_content and \
(prepend_if_not_found or
append_if_not_found) \
else salt.utils.to_str(repl)
@ -2122,7 +2122,7 @@ def replace(path,
if not_found_content is None:
not_found_content = repl
if prepend_if_not_found:
new_file.insert(0, not_found_content + '\n')
new_file.insert(0, not_found_content + b'\n')
else:
# append_if_not_found
# Make sure we have a newline at the end of the file