mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
commit
79c08ef9b6
@ -304,7 +304,12 @@ class Pillar(object):
|
||||
Returns the high data derived from the top file
|
||||
'''
|
||||
tops, errors = self.get_tops()
|
||||
return self.merge_tops(tops), errors
|
||||
try:
|
||||
merged_tops = self.merge_tops(tops)
|
||||
except TypeError as err:
|
||||
merged_tops = OrderedDict()
|
||||
errors.append('Error encountered while render pillar top file.')
|
||||
return merged_tops, errors
|
||||
|
||||
def top_matches(self, top):
|
||||
'''
|
||||
|
@ -1971,19 +1971,22 @@ class BaseHighState(object):
|
||||
for saltenv, targets in ctop.items():
|
||||
if saltenv == 'include':
|
||||
continue
|
||||
for tgt in targets:
|
||||
if tgt not in top[saltenv]:
|
||||
top[saltenv][tgt] = ctop[saltenv][tgt]
|
||||
continue
|
||||
matches = []
|
||||
states = set()
|
||||
for comp in top[saltenv][tgt]:
|
||||
if isinstance(comp, dict):
|
||||
matches.append(comp)
|
||||
if isinstance(comp, string_types):
|
||||
states.add(comp)
|
||||
top[saltenv][tgt] = matches
|
||||
top[saltenv][tgt].extend(list(states))
|
||||
try:
|
||||
for tgt in targets:
|
||||
if tgt not in top[saltenv]:
|
||||
top[saltenv][tgt] = ctop[saltenv][tgt]
|
||||
continue
|
||||
matches = []
|
||||
states = set()
|
||||
for comp in top[saltenv][tgt]:
|
||||
if isinstance(comp, dict):
|
||||
matches.append(comp)
|
||||
if isinstance(comp, string_types):
|
||||
states.add(comp)
|
||||
top[saltenv][tgt] = matches
|
||||
top[saltenv][tgt].extend(list(states))
|
||||
except TypeError:
|
||||
raise SaltRenderError('Unable to render top file. No targets found.')
|
||||
return top
|
||||
|
||||
def verify_tops(self, tops):
|
||||
@ -2499,6 +2502,9 @@ class BaseHighState(object):
|
||||
err = []
|
||||
try:
|
||||
top = self.get_top()
|
||||
except SaltRenderError as err:
|
||||
ret[tag_name]['comment'] = err.error
|
||||
return ret
|
||||
except Exception:
|
||||
trb = traceback.format_exc()
|
||||
err.append(trb)
|
||||
|
Loading…
Reference in New Issue
Block a user