Creates a RuleEnforcer matching to each rule. This method is trigger_instance specific therefore if creation of 1 RuleEnforcer fails it is likely that all wil be broken.
(self, trigger_instance, matching_rules)
| 80 | return matching_rules |
| 81 | |
| 82 | def create_rule_enforcers(self, trigger_instance, matching_rules): |
| 83 | """ |
| 84 | Creates a RuleEnforcer matching to each rule. |
| 85 | |
| 86 | This method is trigger_instance specific therefore if creation of 1 RuleEnforcer |
| 87 | fails it is likely that all wil be broken. |
| 88 | """ |
| 89 | metrics_driver = get_driver() |
| 90 | |
| 91 | enforcers = [] |
| 92 | for matching_rule in matching_rules: |
| 93 | metrics_driver.inc_counter("rule.matched") |
| 94 | metrics_driver.inc_counter("rule.%s.matched" % (matching_rule.ref)) |
| 95 | |
| 96 | enforcers.append(RuleEnforcer(trigger_instance, matching_rule)) |
| 97 | return enforcers |
| 98 | |
| 99 | def enforce_rules(self, enforcers): |
| 100 | for enforcer in enforcers: |
no test coverage detected