Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions _modules/topd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# Import python libs
import fnmatch
import logging
import json # for error messages

# Import salt libs
import salt.fileclient
Expand Down Expand Up @@ -274,10 +275,19 @@ def merge_tops(tops):

# List of complied tops
for _top in tops:
# ensure _top is a valid dictionary
if not isinstance(_top, dict):
raise SaltRenderError('Expected dictionary from SALT envs to ' \
+ 'dictionary of VMs to states, but got: ' + json.dumps(_top))
# Compiled tops of one tops file
for ctops in _top.values():
# Targets in a list
for ctop in ctops:
# ensure ctop is a valid dictionary
if not isinstance(ctop, dict):
raise SaltRenderError('Expected dictionary from VMs to ' \
+ 'list of states, but got: ' + json.dumps(ctop) \
+ '. This was found in ' + json.dumps(_top))
for saltenv, targets in ctop.items():
if saltenv == 'include':
continue
Expand Down