diff --git a/coordinator/strategies.py b/coordinator/strategies.py index 4263d4c..354978c 100644 --- a/coordinator/strategies.py +++ b/coordinator/strategies.py @@ -91,11 +91,14 @@ def strategy_feedback(self, strat, feedback, result = None): st['priority'] = priority if strat is not None: #New message under this strategy - tmp = strat + tmp = dict(strat) tmp['switch'] = strat['switch'] + switch_strat - if len(tmp['switch'] > 2): + if not isinstance(tmp['switch'],dict) or not isinstance(tmp['switch'],list) or len(tmp['switch'] > 2): print "Warning. Possible runaway strategy" print str(tmp) + self.lg.write("Warning. Possible runaway strategy\n") + self.lg.write(str(tmp)+"\n") + self.lg.flush() else: self.strat_lst.append(tmp) else: