Module: check_mk
Branch: master
Commit: b6eceeaf9ea5a35940968ac90ae08dcd86cf058a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6eceeaf9ea5a3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jan 9 12:47:07 2017 +0100
Cleaned up some issues found by the linter
Change-Id: Ia5785b41f31e0d12a23f3b7a936d13e895b58961
---
web/plugins/perfometer/check_mk.py | 12 ++++++------
web/plugins/views/availability.py | 7 +++++--
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index ec05414..3a2b08e 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -257,14 +257,14 @@ def perfometer_temperature_multi(row, check_command, perf_data):
display_color = "#60f020"
for sensor, value, uom, warn, crit, min, max in perf_data:
- value=saveint(value)
+ value = saveint(value)
if value > display_value:
- display_value=value
+ display_value = value
- if display_value > saveint(warn):
- display_color = "#FFC840"
- if display_value > saveint(crit):
- display_color = "#FF0000"
+ if display_value > saveint(warn):
+ display_color = "#FFC840"
+ if display_value > saveint(crit):
+ display_color = "#FF0000"
display_string = "%s °C" % display_value
return display_string, perfometer_linear(display_value, display_color)
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index fce5a1e..b2c2c50 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -397,12 +397,14 @@ def render_availability_table(group_title, availability_table, what,
avoptions):
searchable = False, limit = None,
omit_headers = "omit_headers" in avoptions["labelling"])
+ show_urls, show_timeline = False, False
for row in av_table["rows"]:
table.row()
# Column with icons
timeline_url = None
if row["urls"]:
+ show_urls = True
table.cell("", css="buttons")
for image, tooltip, url in row["urls"]:
html.icon_button(url, tooltip, image)
@@ -414,6 +416,7 @@ def render_availability_table(group_title, availability_table, what,
avoptions):
table.cell(title, '<a href="%s">%s</a>' % (url,
name))
if "timeline" in row:
+ show_timeline = True
table.cell(_("Timeline"), css="timeline")
html.open_a(href=timeline_url)
render_timeline_bar(row["timeline"], "inline")
@@ -425,12 +428,12 @@ def render_availability_table(group_title, availability_table, what,
avoptions):
if "summary" in av_table:
table.row(css="summary")
- if row["urls"]:
+ if show_urls:
table.cell("", "") # Empty cell in URLs column
table.cell("", _("Summary"), css="heading")
for x in range(1, len(av_table["object_titles"])):
table.cell("", "") # empty cells, of more object titles
than one
- if "timeline" in row:
+ if show_timeline:
table.cell("", "")
for (title, help), (text, css) in zip(av_table["cell_titles"],
av_table["summary"]):