13
13
from mamonsu .lib .plugin import Plugin
14
14
from mamonsu .lib .zbx_template import ZbxTemplate
15
15
from mamonsu .lib .get_keys import GetKeys
16
- from distutils .version import LooseVersion
17
16
from mamonsu .plugins .system .linux .scripts import Scripts
18
17
19
18
@@ -86,8 +85,8 @@ def quit_handler(_signo=None, _stack_frame=None):
86
85
if len (commands ) == 2 :
87
86
commands .append ('postgrespro_agent.conf' )
88
87
for klass in Plugin .only_child_subclasses ():
89
- if klass .__name__ != "PgWaitSampling" and klass .__name__ != "Cfs" :
90
- plugins .append (klass (cfg ))
88
+ if klass .__name__ != "PgWaitSampling" and klass .__name__ != "Cfs" :
89
+ plugins .append (klass (cfg ))
91
90
args .plugin_type = correct_plugin_type (args .plugin_type )
92
91
if args .plugin_type == 'pg' or args .plugin_type == 'sys' or args .plugin_type == 'all' :
93
92
template = GetKeys ()
@@ -111,7 +110,7 @@ def quit_handler(_signo=None, _stack_frame=None):
111
110
Plugin .PATH = path
112
111
# create directory for scripts along the path of conf file if needed
113
112
if not os .path .exists (path ):
114
- os .makedirs (path )
113
+ os .makedirs (path )
115
114
for key in Scripts .Bash :
116
115
with codecs .open (path + "/" + key + ".sh" , 'w+' , 'utf-8' ) as f :
117
116
# configuration file for zabbix-agent is generated for selected plugin-type
@@ -139,7 +138,7 @@ def quit_handler(_signo=None, _stack_frame=None):
139
138
if len (commands ) == 2 :
140
139
commands .append ('postgrespro.xml' )
141
140
for klass in Plugin .only_child_subclasses ():
142
- plugins .append (klass (cfg ))
141
+ plugins .append (klass (cfg ))
143
142
template = ZbxTemplate (args .template , args .application )
144
143
try :
145
144
fd = codecs .open (commands [2 ], 'w' , 'utf-8' )
@@ -158,7 +157,7 @@ def quit_handler(_signo=None, _stack_frame=None):
158
157
if args .plugin_type == 'pg' or args .plugin_type == 'sys' or args .plugin_type == 'all' :
159
158
for klass in Plugin .only_child_subclasses ():
160
159
if klass .__name__ != "PgWaitSampling" and klass .__name__ != "Cfs" : # check if plugin is for EE
161
- plugins .append (klass (cfg ))
160
+ plugins .append (klass (cfg ))
162
161
template = ZbxTemplate (args .template , args .application )
163
162
try :
164
163
fd = codecs .open (commands [2 ], 'w' , 'utf-8' )
@@ -243,7 +242,7 @@ def correct_plugin_type(plugin_type):
243
242
print ("Got equal plugin types. See help 'mamonsu -- help' " )
244
243
sys .exit (2 )
245
244
# if plugin type name is wrong
246
- if False in [type in valid_plugin_types for type in types ]:
245
+ if False in [t in valid_plugin_types for t in types ]:
247
246
print ("Got wrong plugin types. See help 'mamonsu -- help' " )
248
247
sys .exit (2 )
249
248
else :
0 commit comments