Merge pull request #13864 from whiteinge/salt-ssh-sls-dict-tweaks

Tweaks to salt-ssh error handling
This commit is contained in:
Thomas S Hatch 2014-07-01 16:59:01 -06:00
commit cc91ebd6dd
2 changed files with 7 additions and 2 deletions

View File

@ -14,7 +14,7 @@ import salt.utils
import salt.client.ssh
class FunctionWrapper(object):
class FunctionWrapper(dict):
'''
Create an object that acts like the salt function dict and makes function
calls remotely via the SSH shell system

View File

@ -80,7 +80,12 @@ def sls(mods, saltenv='base', test=None, exclude=None, env=None, **kwargs):
trans_tar,
'/tmp/.salt/salt_state.tgz')
stdout, stderr, _ = single.cmd_block()
return json.loads(stdout, object_hook=salt.utils.decode_dict)
try:
return json.loads(stdout, object_hook=salt.utils.decode_dict)
except Exception, e:
log.error("JSON Render failed for: {0}".format(stdout))
log.error(str(e))
return stdout
def low(data, **kwargs):