mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #25675 from UtahDave/2015.5local
Use OS line endings with contents on file.managed
This commit is contained in:
commit
18e739b812
1 changed files with 4 additions and 0 deletions
|
@ -3440,6 +3440,8 @@ def manage_file(name,
|
|||
if contents is not None:
|
||||
# Write the static contents to a temporary file
|
||||
tmp = salt.utils.mkstemp(text=True)
|
||||
if salt.utils.is_windows():
|
||||
contents = os.linesep.join(contents.splitlines())
|
||||
with salt.utils.fopen(tmp, 'w') as tmp_:
|
||||
tmp_.write(str(contents))
|
||||
|
||||
|
@ -3612,6 +3614,8 @@ def manage_file(name,
|
|||
if contents is not None:
|
||||
# Write the static contents to a temporary file
|
||||
tmp = salt.utils.mkstemp(text=True)
|
||||
if salt.utils.is_windows():
|
||||
contents = os.linesep.join(contents.splitlines())
|
||||
with salt.utils.fopen(tmp, 'w') as tmp_:
|
||||
tmp_.write(str(contents))
|
||||
# Copy into place
|
||||
|
|
Loading…
Add table
Reference in a new issue