Skip to content

Commit

Permalink
handle not string objects
Browse files Browse the repository at this point in the history
  • Loading branch information
mchugh19 committed Mar 30, 2019
1 parent 5354f24 commit 87b6843
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions salt/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -2134,19 +2134,26 @@ def format_slots(self, cdata):
if isinstance(arg, dict):
# Search dictionary values for __slot__:
for key, value in arg.items():
if isinstance(value, six.text_type):
try:
if value.startswith(SLOT_TEXT):
log.debug("Slot processsing dict value %s", value)
cdata[atype][ind][key] = self.__eval_slot(value)
except AttributeError:
# Not a string/slot
continue
elif isinstance(arg, list):
for idx, listvalue in enumerate(arg):
log.debug("Slot processing list value: %s", listvalue)
if isinstance(listvalue, dict):
# Search dict values in list for __slot__:
for key, value in listvalue.items():
if value.startswith(SLOT_TEXT):
log.debug("Slot processsing nested dict value %s", value)
cdata[atype][ind][idx][key] = self.__eval_slot(value)
try:
if value.startswith(SLOT_TEXT):
log.debug("Slot processsing nested dict value %s", value)
cdata[atype][ind][idx][key] = self.__eval_slot(value)
except AttributeError:
# Not a string/slot
continue
if isinstance(listvalue, six.text_type):
# Search strings in a list for __slot__:
if listvalue.startswith(SLOT_TEXT):
Expand Down

0 comments on commit 87b6843

Please sign in to comment.