From 87b6843339d000e2df169a8547a8704e36f5bb65 Mon Sep 17 00:00:00 2001 From: Christian McHugh Date: Sat, 30 Mar 2019 05:31:56 +0000 Subject: [PATCH] handle not string objects --- salt/state.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/salt/state.py b/salt/state.py index f1dbd00af012..6bfac7881327 100644 --- a/salt/state.py +++ b/salt/state.py @@ -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):