mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #11733 from cachedout/11609
Support kwargs in salt-ssh
This commit is contained in:
commit
19f7baf490
@ -545,7 +545,7 @@ class Single(object):
|
|||||||
**kwargs):
|
**kwargs):
|
||||||
self.opts = opts
|
self.opts = opts
|
||||||
self.arg_str = arg_str
|
self.arg_str = arg_str
|
||||||
self.fun, self.arg = self.__arg_comps()
|
self.fun, self.arg, self.kwargs = self.__arg_comps()
|
||||||
self.id = id_
|
self.id = id_
|
||||||
|
|
||||||
args = {'host': host,
|
args = {'host': host,
|
||||||
@ -573,8 +573,16 @@ class Single(object):
|
|||||||
'''
|
'''
|
||||||
comps = self.arg_str.split()
|
comps = self.arg_str.split()
|
||||||
fun = comps[0] if comps else ''
|
fun = comps[0] if comps else ''
|
||||||
arg = comps[1:]
|
args = comps[1:]
|
||||||
return fun, arg
|
s_args = []
|
||||||
|
kws = {}
|
||||||
|
for arg in args:
|
||||||
|
if '=' in arg:
|
||||||
|
(key, val) = arg.split('=')
|
||||||
|
kws[key] = val
|
||||||
|
else:
|
||||||
|
s_args.append(arg)
|
||||||
|
return fun, s_args, kws
|
||||||
|
|
||||||
def deploy(self):
|
def deploy(self):
|
||||||
'''
|
'''
|
||||||
@ -679,7 +687,7 @@ class Single(object):
|
|||||||
**self.target)
|
**self.target)
|
||||||
self.wfuncs = salt.loader.ssh_wrapper(opts, wrapper)
|
self.wfuncs = salt.loader.ssh_wrapper(opts, wrapper)
|
||||||
wrapper.wfuncs = self.wfuncs
|
wrapper.wfuncs = self.wfuncs
|
||||||
ret = json.dumps(self.wfuncs[self.fun](*self.arg))
|
ret = json.dumps(self.wfuncs[self.fun](*self.arg, **self.kwargs))
|
||||||
return ret, '', None
|
return ret, '', None
|
||||||
|
|
||||||
def cmd(self):
|
def cmd(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user