Skip to content

Commit 372dc08

Browse files
author
Alexander Popov
committed
fiex: PGPRO-4092
1 parent 7235c9d commit 372dc08

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

mamonsu/lib/plugin.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,15 @@ def run(self, sender):
123123
def is_sender(self):
124124
return self._sender
125125

126+
def get_boolean(self, value):
127+
if value:
128+
if value.upper() in ('FALSE', '0', 'NO', 'F'):
129+
return False
130+
return True
131+
126132
def is_enabled(self):
127-
if self.plugin_config('enabled') == 'False':
128-
return False
133+
if self.plugin_config('enabled'):
134+
return self.get_boolean(self.plugin_config('enabled'))
129135
return self._enabled
130136

131137
def disable(self):

mamonsu/plugins/pgsql/cfs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ class Cfs(Plugin):
4848
prev = {}
4949

5050
def run(self, zbx):
51-
52-
if self.plugin_config('force_enable') == 'False':
53-
self.disable_and_exit_if_not_pgpro_ee()
51+
if self.plugin_config('force_enable'):
52+
if not self.get_boolean(self.plugin_config('force_enable')):
53+
self.disable_and_exit_if_not_pgpro_ee()
5454

5555
# tick every 100 seconds
5656
if self.ratioCounter == self.ratioInterval:

0 commit comments

Comments
 (0)