Remove debug statements

This commit is contained in:
Mark Veidemanis 2023-02-09 22:55:18 +00:00
parent 2356c6bcd7
commit 090fae013d
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 0 additions and 11 deletions

View File

@ -376,11 +376,7 @@ class ElasticsearchBackend(StorageBackend):
for index, (meta, result) in result_map.items(): for index, (meta, result) in result_map.items():
# Default to true, if no aggs are found, we still want to match # Default to true, if no aggs are found, we still want to match
match = True match = True
print("RULE OBJECT", rule_object.aggs)
print("META", meta)
for agg_name, (operator, number) in rule_object.aggs.items(): for agg_name, (operator, number) in rule_object.aggs.items():
print("AGG NAME", agg_name, "OPERATOR", operator, "NUMBER", number)
if agg_name in meta["aggs"]: if agg_name in meta["aggs"]:
agg_value = meta["aggs"][agg_name]["value"] agg_value = meta["aggs"][agg_name]["value"]

View File

@ -310,7 +310,6 @@ class NotificationRuleData(object):
""" """
new_aggs = {} new_aggs = {}
for agg_name, agg in aggs.items(): for agg_name, agg in aggs.items():
print("ITER", agg_name, agg)
# Already checked membership below # Already checked membership below
if agg_name in self.aggs: if agg_name in self.aggs:
op, value = self.aggs[agg_name] op, value = self.aggs[agg_name]
@ -384,7 +383,6 @@ class NotificationRuleData(object):
meta["matched"] = self.format_matched(message) meta["matched"] = self.format_matched(message)
if "aggs" in meta: if "aggs" in meta:
meta["matched"] = self.format_aggs(meta["aggs"]) meta["matched"] = self.format_aggs(meta["aggs"])
print("MATCHED", meta["matched"])
rule_notify(self.object, index, message, meta) rule_notify(self.object, index, message, meta)
self.store_match(index, message) self.store_match(index, message)
@ -482,14 +480,9 @@ class NotificationRuleData(object):
if "match" in meta["aggs"][agg_name]: if "match" in meta["aggs"][agg_name]:
aggs_for_index.append(meta["aggs"][agg_name]["match"]) aggs_for_index.append(meta["aggs"][agg_name]["match"])
print("aggs_for_index", aggs_for_index)
print("self aggs", self.aggs.keys())
# All required aggs are present # All required aggs are present
if len(aggs_for_index) == len(self.aggs.keys()): if len(aggs_for_index) == len(self.aggs.keys()):
print("Key len match")
if all(aggs_for_index): if all(aggs_for_index):
print("all aggs for index true")
# All aggs have matched # All aggs have matched
await self.rule_matched( await self.rule_matched(
index, results[: self.object.amount], meta, mode="schedule" index, results[: self.object.amount], meta, mode="schedule"