Commit 1fe673e2 authored by Łukasz Nowak's avatar Łukasz Nowak

promise/plugin: check_file_state configurability fix

Fail early in case of bad promise configuration.
parent f5bcc917
...@@ -12,6 +12,10 @@ class RunPromise(GenericPromise): ...@@ -12,6 +12,10 @@ class RunPromise(GenericPromise):
self.setPeriodicity(float(self.getConfig('frequency', 2))) self.setPeriodicity(float(self.getConfig('frequency', 2)))
self.result_count = int(self.getConfig('result-count', '1')) self.result_count = int(self.getConfig('result-count', '1'))
self.failure_amount = int(self.getConfig('failure-amount', '1')) self.failure_amount = int(self.getConfig('failure-amount', '1'))
if self.result_count < self.failure_amount:
raise ValueError(
'Bad configuration: result-count %i < failure_amount %i' % (
self.result_count, self.failure_amount))
if self.getConfig( if self.getConfig(
'perdiodic-only', 'false').lower() in ('true', 'yes', '1'): 'perdiodic-only', 'false').lower() in ('true', 'yes', '1'):
......
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