mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Switch usage for cli example. Double to single quotes plus formatting.
This commit is contained in:
parent
0d5c3b5f0c
commit
de99865de9
@ -508,14 +508,18 @@ def sed(path, before, after, limit='', backup='.bak', options='-r -e',
|
||||
if sys.platform == 'darwin':
|
||||
options = options.replace('-r', '-E')
|
||||
|
||||
cmd = r"sed {backup}{options} '{limit}s/{before}/{after}/{flags}' {path}".format(
|
||||
cmd = (
|
||||
r'''sed {backup}{options} '{limit}s/{before}/{after}/{flags}' {path}'''
|
||||
.format(
|
||||
backup='-i{0} '.format(backup) if backup else '-i ',
|
||||
options=options,
|
||||
limit='/{0}/ '.format(limit) if limit else '',
|
||||
before=before,
|
||||
after=after,
|
||||
flags=flags,
|
||||
path=path)
|
||||
path=path
|
||||
)
|
||||
)
|
||||
|
||||
return __salt__['cmd.run_all'](cmd)
|
||||
|
||||
@ -527,7 +531,7 @@ def sed_contains(path, text, limit='', flags='g'):
|
||||
|
||||
Note: the ``p`` flag will be added to any flags you pass in.
|
||||
|
||||
Usage::
|
||||
CLI Example::
|
||||
|
||||
salt '*' file.contains /etc/crontab 'mymaintenance.sh'
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user