mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #23368 from kaithar/bp-23367
Backport #23367 to 2014.7
This commit is contained in:
commit
0c76dd4d8a
1 changed files with 4 additions and 2 deletions
|
@ -40,8 +40,10 @@ def _add_var(var, value):
|
|||
fullvar = '{0}="{1}"'.format(var, value)
|
||||
if __salt__['file.contains'](makeconf, layman):
|
||||
# TODO perhaps make this a function in the file module?
|
||||
cmd = ['sed', '-i', '/{0}/'.format(layman.replace('/', '\\/')),
|
||||
fullvar, makeconf]
|
||||
cmd = ['sed', '-i', r'/{0}/ i\{1}'.format(
|
||||
layman.replace('/', '\\/'),
|
||||
fullvar),
|
||||
makeconf]
|
||||
__salt__['cmd.run'](cmd)
|
||||
else:
|
||||
__salt__['file.append'](makeconf, fullvar)
|
||||
|
|
Loading…
Add table
Reference in a new issue