Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix module.run state for non-dict return data #16981

Merged
merged 1 commit into from Oct 30, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion salt/states/module.py
Expand Up @@ -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