Commit 068b8541 authored by Łukasz Nowak's avatar Łukasz Nowak

promise/plugin: check_file_state configurability

Allow to configure result_count and failure_amount.
parent e659a7b2
Pipeline #35693 failed with stage
in 0 seconds
...@@ -10,6 +10,8 @@ class RunPromise(GenericPromise): ...@@ -10,6 +10,8 @@ class RunPromise(GenericPromise):
super(RunPromise, self).__init__(config) super(RunPromise, self).__init__(config)
# SR can set custom periodicity # SR can set custom periodicity
self.setPeriodicity(float(self.getConfig('frequency', 2))) self.setPeriodicity(float(self.getConfig('frequency', 2)))
self.result_count = int(self.getConfig('result_count', '1'))
self.failure_amount = int(self.getConfig('failure_amount', '1'))
def sense(self): def sense(self):
""" """
...@@ -56,4 +58,5 @@ class RunPromise(GenericPromise): ...@@ -56,4 +58,5 @@ class RunPromise(GenericPromise):
self.logger.info("OK %r state %r" % (filename, state)) self.logger.info("OK %r state %r" % (filename, state))
def anomaly(self): def anomaly(self):
return self._anomaly(result_count=1, failure_amount=1) return self._anomaly(
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