Support for setm augeas command.

Fix build on top of 2015.5.x version
This commit is contained in:
Frederic Brin 2015-07-24 19:52:21 +02:00 committed by root
parent 7914f51636
commit ee97896cba

View File

@ -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: