mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #25705 from blackduckx/augeas-setm
Support for setm augeas command.
This commit is contained in:
commit
82ba390b7b
2 changed files with 9 additions and 1 deletions
|
@ -104,6 +104,7 @@ def execute(context=None, lens=None, commands=()):
|
|||
|
||||
method_map = {
|
||||
'set': 'set',
|
||||
'setm': 'setm',
|
||||
'mv': 'move',
|
||||
'move': 'move',
|
||||
'ins': 'insert',
|
||||
|
@ -136,6 +137,13 @@ def execute(context=None, lens=None, commands=()):
|
|||
path = os.path.join(context.rstrip('/'), path.lstrip('/'))
|
||||
value = value.strip('"').strip("'")
|
||||
args = {'path': path, 'value': value}
|
||||
elif method == 'setm':
|
||||
base, sub, value = re.findall('([^\'" ]+|"[^"]*"|\'[^\']*\')', arg)
|
||||
base = base.rstrip()
|
||||
if context:
|
||||
base = os.path.join(context.rstrip('/'), base.lstrip('/'))
|
||||
value = value.strip('"').strip("'")
|
||||
args = {'base': base, 'sub': sub, 'value': value}
|
||||
elif method == 'move':
|
||||
path, dst = arg.split(' ', 1)
|
||||
if context:
|
||||
|
|
|
@ -76,7 +76,7 @@ def change(name, context=None, changes=None, lens=None, **kwargs):
|
|||
|
||||
changes
|
||||
List of changes that are issued to Augeas. Available commands are
|
||||
``set``, ``mv``/``move``, ``ins``/``insert``, and ``rm``/``remove``.
|
||||
``set``, ``setm``, ``mv``/``move``, ``ins``/``insert``, and ``rm``/``remove``.
|
||||
|
||||
lens
|
||||
The lens to use, needs to be suffixed with `.lns`, e.g.: `Nginx.lns`. See
|
||||
|
|
Loading…
Add table
Reference in a new issue