mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Fix #16071
This commit is contained in:
parent
8519139382
commit
074448bd56
@ -651,7 +651,7 @@ class Single(object):
|
||||
|
||||
if '_error' in opts_pkg:
|
||||
#Refresh failed
|
||||
ret = json.dumps({'local': opts_pkg['_error']})
|
||||
ret = json.dumps({'local': opts_pkg})
|
||||
return ret
|
||||
|
||||
pillar = salt.pillar.Pillar(
|
||||
@ -693,7 +693,12 @@ class Single(object):
|
||||
**self.target)
|
||||
self.wfuncs = salt.loader.ssh_wrapper(opts, wrapper)
|
||||
wrapper.wfuncs = self.wfuncs
|
||||
result = self.wfuncs[self.fun](*self.args, **self.kwargs)
|
||||
try:
|
||||
result = self.wfuncs[self.fun](*self.args, **self.kwargs)
|
||||
except TypeError as exc:
|
||||
result = 'TypeError encountered executing {0}: {1}'.format(self.fun, exc)
|
||||
except Exception as exc:
|
||||
result = 'An Exception occured while executing {0}: {1}'.format(self.fun, exc)
|
||||
# Mimic the json data-structure that "salt-call --local" will
|
||||
# emit (as seen in ssh_py_shim.py)
|
||||
if 'local' in result:
|
||||
|
Loading…
Reference in New Issue
Block a user