mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
[38451] Fix few bugs after review
This commit is contained in:
parent
1bdab253ad
commit
81f0337338
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue