mirror of
https://codeberg.org/privacy1st/de-p1st-monitor
synced 2024-11-21 19:33:18 +01:00
refactor
This commit is contained in:
parent
ceace1ba3e
commit
8acae50b3b
@ -24,9 +24,12 @@ class Logger(ABC):
|
||||
|
||||
# Either both variables are given, or both are None
|
||||
if warn_if_above is not None and critical_if_above is not None:
|
||||
assert critical_if_above > warn_if_above
|
||||
if critical_if_above <= warn_if_above:
|
||||
raise Exception(f'The critical limit is not greater that the warning limit:'
|
||||
f' {critical_if_above}, {warn_if_above}')
|
||||
else:
|
||||
assert warn_if_above is None and critical_if_above is None
|
||||
if warn_if_above is not None or critical_if_above is not None:
|
||||
raise Exception('Either both, warn_if_above and critical_if_above, must be given, or both must be None.')
|
||||
self.warn_if_above = warn_if_above
|
||||
self.critical_if_above = critical_if_above
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user