Bailout if a state function returns anything but dictionary type

This commit is contained in:
Bo Maryniuk 2018-01-16 18:02:33 +01:00
parent 9df156ed7c
commit 0baddd675a

View File

@ -1905,6 +1905,9 @@ class State(object):
self.state_con.pop('runas', None)
self.state_con.pop('runas_password', None)
if not isinstance(ret, dict):
return ret
# If format_call got any warnings, let's show them to the user
if 'warnings' in cdata:
ret.setdefault('warnings', []).extend(cdata['warnings'])