check_result: Correctly check the __extend__ state.

https://github.com/saltstack/salt/issues/42512

check_state_result() is expecting each highstate item to be a dict, but
states using extend are lists.

Conflicts:
  - salt/utils/state.py
This commit is contained in:
comsul 2017-09-29 19:27:02 +08:00 committed by rallytime
parent 1643bb7fd4
commit f81bb61f2d
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19

View file

@ -2016,7 +2016,11 @@ def check_state_result(running, recurse=False, highstate=None):
ret = True
for state_id, state_result in six.iteritems(running):
if not recurse and not isinstance(state_result, dict):
expected_type = dict
# The __extend__ state is a list
if "__extend__" == state_id:
expected_type = list
if not recurse and not isinstance(state_result, expected_type):
ret = False
if ret and isinstance(state_result, dict):
result = state_result.get('result', _empty)