Merge pull request #25675 from UtahDave/2015.5local

Use OS line endings with contents on file.managed
This commit is contained in:
Thomas S Hatch 2015-07-24 10:29:50 -06:00
commit 18e739b812

View file

@ -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