Skip to content

Commit

Permalink
Merge pull request saltstack#18281 from cro/mdadm_update
Browse files Browse the repository at this point in the history
Properly quote parameters to mdadm
  • Loading branch information
thatch45 committed Nov 21, 2014
2 parents 3b91d96 + ae2b506 commit c02e2e9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions salt/modules/makeconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ 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 = r"sed -i '/{0}/ i\{1}' {2}".format(
layman.replace("/", "\\/"),
fullvar,
makeconf)
print cmd
cmd = ['sed', '-i', '/{0}/'.format(layman.replace('/', '\\/')),
fullvar, makeconf]
__salt__['cmd.run'](cmd)
else:
__salt__['file.append'](makeconf, fullvar)
Expand Down

0 comments on commit c02e2e9

Please sign in to comment.