1313from mamonsu .lib .plugin import Plugin
1414from mamonsu .lib .zbx_template import ZbxTemplate
1515from mamonsu .lib .get_keys import GetKeys
16- from distutils .version import LooseVersion
1716from mamonsu .plugins .system .linux .scripts import Scripts
1817
1918
@@ -86,8 +85,8 @@ def quit_handler(_signo=None, _stack_frame=None):
8685 if len (commands ) == 2 :
8786 commands .append ('postgrespro_agent.conf' )
8887 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 ))
9190 args .plugin_type = correct_plugin_type (args .plugin_type )
9291 if args .plugin_type == 'pg' or args .plugin_type == 'sys' or args .plugin_type == 'all' :
9392 template = GetKeys ()
@@ -111,7 +110,7 @@ def quit_handler(_signo=None, _stack_frame=None):
111110 Plugin .PATH = path
112111 # create directory for scripts along the path of conf file if needed
113112 if not os .path .exists (path ):
114- os .makedirs (path )
113+ os .makedirs (path )
115114 for key in Scripts .Bash :
116115 with codecs .open (path + "/" + key + ".sh" , 'w+' , 'utf-8' ) as f :
117116 # configuration file for zabbix-agent is generated for selected plugin-type
@@ -139,7 +138,7 @@ def quit_handler(_signo=None, _stack_frame=None):
139138 if len (commands ) == 2 :
140139 commands .append ('postgrespro.xml' )
141140 for klass in Plugin .only_child_subclasses ():
142- plugins .append (klass (cfg ))
141+ plugins .append (klass (cfg ))
143142 template = ZbxTemplate (args .template , args .application )
144143 try :
145144 fd = codecs .open (commands [2 ], 'w' , 'utf-8' )
@@ -158,7 +157,7 @@ def quit_handler(_signo=None, _stack_frame=None):
158157 if args .plugin_type == 'pg' or args .plugin_type == 'sys' or args .plugin_type == 'all' :
159158 for klass in Plugin .only_child_subclasses ():
160159 if klass .__name__ != "PgWaitSampling" and klass .__name__ != "Cfs" : # check if plugin is for EE
161- plugins .append (klass (cfg ))
160+ plugins .append (klass (cfg ))
162161 template = ZbxTemplate (args .template , args .application )
163162 try :
164163 fd = codecs .open (commands [2 ], 'w' , 'utf-8' )
@@ -243,7 +242,7 @@ def correct_plugin_type(plugin_type):
243242 print ("Got equal plugin types. See help 'mamonsu -- help' " )
244243 sys .exit (2 )
245244 # 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 ]:
247246 print ("Got wrong plugin types. See help 'mamonsu -- help' " )
248247 sys .exit (2 )
249248 else :
0 commit comments