Skip to content

Commit a212ec7

Browse files
committed
style: fixed indentations and comment for variable
1 parent 5b0e8b1 commit a212ec7

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

mamonsu/lib/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Plugin(object):
3333
Interval = 60
3434

3535
# plugin config
36-
DEFAULT_CONFIG = {} # type: dict[str, str]
36+
DEFAULT_CONFIG = {} # type
3737

3838
_thread = None # type: Thread
3939
_sender = False

mamonsu/lib/runner.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from mamonsu.lib.plugin import Plugin
1414
from mamonsu.lib.zbx_template import ZbxTemplate
1515
from mamonsu.lib.get_keys import GetKeys
16-
from distutils.version import LooseVersion
1716
from 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:

mamonsu/plugins/system/windows/cpu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Cpu(Plugin):
1313
'User time', Plugin.UNITS.percent, 'CC0000'),
1414

1515
(r'\Processor(*)\% Idle Time', '[idle_time]',
16-
'Idle time', Plugin.UNITS.percent, ('00CC00')),
16+
'Idle time', Plugin.UNITS.percent, '00CC00'),
1717

1818
(r'\Processor(*)\% Privileged Time', '[privileged_time]',
1919
'Privileged time', Plugin.UNITS.percent, ('770000')),

0 commit comments

Comments
 (0)