Use write instead of writelines for Windows

This commit is contained in:
twangboy 2018-02-27 16:49:43 -07:00
parent adc8950bbe
commit 9ea02d7045
No known key found for this signature in database
GPG key ID: 93FF3BDEB278C9EB

View file

@ -173,7 +173,8 @@ def _replace_auth_key(
# Re-open the file writable after properly closing it
with salt.utils.files.fopen(full, 'w') as _fh:
# Write out any changes
_fh.writelines(lines)
for line in lines:
_fh.write(line)
except (IOError, OSError) as exc:
raise CommandExecutionError(
'Problem reading or writing to key file: {0}'.format(exc)