From b2c47f75dbda045bf770d97d9685b84b5510023c Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Tue, 28 Oct 2014 15:11:44 -0600 Subject: [PATCH] Fix module.run state for non-dict return data This backports part of a fix for this that is already in the 2014.7 branch, properly handling execution module functions which return non-dict data. --- salt/states/module.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/salt/states/module.py b/salt/states/module.py index 18f49166b31d..a1436d2422d4 100644 --- a/salt/states/module.py +++ b/salt/states/module.py @@ -200,8 +200,12 @@ def run(name, **kwargs): returners[kwargs['returner']](ret_ret) ret['comment'] = 'Module function {0} executed'.format(name) ret['result'] = True - if ret['changes'].get('ret', {}).get('retcode', 0) != 0: + if ret['changes'].get('retcode', 0) != 0: ret['result'] = False + else: + changes_ret = ret['changes'].get('ret', {}) + if isinstance(changes_ret, dict) and changes_ret.get('retcode', 0) != 0: + ret['result'] = False return ret mod_watch = run # pylint: disable=C0103