Commit cc1d5d16 authored by Łukasz Nowak's avatar Łukasz Nowak Committed by Łukasz Nowak

promise/plugin: Allow to configure anomaly in check_command_execute

parent fcc8ff83
......@@ -11,6 +11,8 @@ class RunPromise(GenericPromise):
super(RunPromise, self).__init__(config)
# SR can set custom periodicity
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):
"""
......@@ -39,4 +41,4 @@ class RunPromise(GenericPromise):
self.logger.info("OK %r run with success" % (command,))
def anomaly(self):
return self._anomaly(result_count=3, failure_amount=3)
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