Commit e0feb245 authored by Łukasz Nowak's avatar Łukasz Nowak

promise: Allow to configure failure_amount in check_surykatka_json

parent 377bcc8f
...@@ -24,6 +24,8 @@ class RunPromise(GenericPromise): ...@@ -24,6 +24,8 @@ class RunPromise(GenericPromise):
super(RunPromise, self).__init__(config) super(RunPromise, self).__init__(config)
# Set frequency compatible to default surykatka interval - 2 minutes # Set frequency compatible to default surykatka interval - 2 minutes
self.setPeriodicity(float(self.getConfig('frequency', 2))) self.setPeriodicity(float(self.getConfig('frequency', 2)))
self.failure_amount = int(self.getConfig('failure_amount', 3))
self.result_count = self.failure_amount
self.error_list = [] self.error_list = []
self.info_list = [] self.info_list = []
...@@ -268,4 +270,5 @@ class RunPromise(GenericPromise): ...@@ -268,4 +270,5 @@ class RunPromise(GenericPromise):
self.emitLog() self.emitLog()
def anomaly(self): def anomaly(self):
return self._test(result_count=3, failure_amount=3) return self._test(
result_count=self.result_count, failure_amount=self.failure_amount)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment