mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Add cli capability for compound execution
This commit is contained in:
parent
65b781560d
commit
5ee7d21e5f
@ -127,8 +127,19 @@ class SaltCMD(object):
|
||||
opts['tgt'] = args[0].split(',')
|
||||
else:
|
||||
opts['tgt'] = args[0]
|
||||
opts['fun'] = args[1]
|
||||
opts['arg'] = args[2:]
|
||||
if args[1].count(','):
|
||||
opts['fun'] = arg[1].split(',')
|
||||
opts['arg'] = []
|
||||
for comp in ' '.join(arg[2:]).split(','):
|
||||
opts['arg'].append(comp.split())
|
||||
if len(opts['fun']) != len(opts['arg']):
|
||||
err = 'Cannot execute compound command without defining'\
|
||||
+ ' all arguments.'
|
||||
sys.stderr.write(err + '\n')
|
||||
sys.exit(42)
|
||||
else:
|
||||
opts['fun'] = args[1]
|
||||
opts['arg'] = args[2:]
|
||||
|
||||
return opts
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user