mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #26529 from mnalt/fix_freebsdservice_module_for_missing_rcconf
bugfix: fix service.enable for missing rc.conf
This commit is contained in:
commit
dfd8c457bd
@ -162,7 +162,7 @@ def _switch(name, # pylint: disable=C0103
|
||||
edited = True
|
||||
if not edited:
|
||||
# Ensure that the file ends in a \n
|
||||
if nlines[-1][-1] != '\n':
|
||||
if len(nlines) > 1 and nlines[-1][-1] != '\n':
|
||||
nlines[-1] = '{0}\n'.format(nlines[-1])
|
||||
nlines.append('{0}="{1}"\n'.format(rcvar, val))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user