Lines 1-21
Link Here
|
1 |
commit 101f170fe525d7f9f8d0c9b80a78af2ed1f6f069 |
|
|
2 |
Author: Mathieu Arnold <mat@mat.cc> |
3 |
Date: 2018-06-13 13:02:37 +0200 |
4 |
|
5 |
Fix patching sysctl.conf on FreeBSD. |
6 |
|
7 |
In b3c1be27fb the lines were stripped of their ending \n, but the \n was |
8 |
never added back to the lines, so calling writelines generates a broken |
9 |
one line file. |
10 |
|
11 |
--- salt/modules/freebsd_sysctl.py.orig 2018-04-02 16:35:12 UTC |
12 |
+++ salt/modules/freebsd_sysctl.py |
13 |
@@ -165,7 +165,7 @@ def persist(name, value, config='/etc/sy |
14 |
if not edited: |
15 |
nlines.append("{0}\n".format(_formatfor(name, value, config))) |
16 |
with salt.utils.files.fopen(config, 'w+') as ofile: |
17 |
- nlines = [salt.utils.stringutils.to_str(_l) for _l in nlines] |
18 |
+ nlines = [salt.utils.stringutils.to_str(_l) + '\n' for _l in nlines] |
19 |
ofile.writelines(nlines) |
20 |
if config != '/boot/loader.conf': |
21 |
assign(name, value) |