Skip to content

Commit

Permalink
Ref. #71 Fix rule type not properly set
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmingrz committed Mar 11, 2017
1 parent b603978 commit a29903d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pad/rules/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def _handle_yaml_element(self, yaml_dict, _depth):

# If the element is a dict maybe it can describe a rule
elif isinstance(value, dict):

# import pdb; pdb.set_trace()
# If the rule is not present in the results
if key not in self.results:
self.results[key] = dict()
Expand All @@ -234,15 +234,15 @@ def _handle_yaml_element(self, yaml_dict, _depth):
if value[param] in RULES or value[
param] in self.ctxt.cmds:

self.results[key][param] = value[param]
# If the value was allready added we should
# set the rule target and change the type
# to eval
if "value" in self.results[key]:
if self.results[key]["value"].startswith("eval:"):
self.results[key]["target"] = value["type"]
self.results[key]["type"] = "eval"
else:
self.results[key][param] = value[param]


elif param == "value":
# If we have an eval rule, update the type and
Expand Down

0 comments on commit a29903d

Please sign in to comment.