Skip __exclude__ in find_sls_ids

The corresponding value would be a list and thus raises a TypeError when
attempting to perform a dict lookup.
This commit is contained in:
Erik Johnson 2018-05-16 10:11:31 -05:00
parent a2ed8cbb7f
commit 28a7d2b81c
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -243,11 +243,21 @@ def find_sls_ids(sls, high):
'''
ret = []
for nid, item in six.iteritems(high):
if item['__sls__'] == sls:
for st_ in item:
if st_.startswith('__'):
continue
ret.append((nid, st_))
try:
sls_tgt = item['__sls__']
except TypeError:
if nid != '__exclude__':
log.error(
'Invalid non-dict item \'%s\' in high data. Value: %r',
nid, item
)
continue
else:
if sls_tgt == sls:
for st_ in item:
if st_.startswith('__'):
continue
ret.append((nid, st_))
return ret