mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix sysctl truncating newline on os x
This commit is contained in:
parent
6759f79d6d
commit
f9a19720de
1 changed files with 2 additions and 0 deletions
|
@ -176,9 +176,11 @@ def persist(name, value, config='/etc/sysctl.conf', apply_change=False):
|
|||
return 'Already set'
|
||||
new_line = '{0}={1}'.format(name, value)
|
||||
nlines.append(new_line)
|
||||
nlines.append('\n')
|
||||
edited = True
|
||||
if not edited:
|
||||
nlines.append('{0}={1}'.format(name, value))
|
||||
nlines.append('\n')
|
||||
with salt.utils.fopen(config, 'w+') as ofile:
|
||||
ofile.writelines(nlines)
|
||||
# If apply_change=True, apply edits to system
|
||||
|
|
Loading…
Add table
Reference in a new issue