Module: check_mk
Branch: master
Commit: 18022fe36a94cd6f597d01ac381e9f1ff096e812
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=18022fe36a94cd…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Jul 17 14:18:46 2018 +0200
Fixed and enabled superfluous-parens warnings.
Change-Id: I3287c8c78dce866569b0e4939805b46b73c626fc
---
checks/apache_status | 4 ++--
checks/ewon | 2 +-
checks/f5_bigip_fans | 2 +-
checks/h3c_lanswitch_cpu | 2 +-
checks/hitachi_hus.include | 4 ++--
cmk/gui/plugins/visuals/wato.py | 4 ++--
cmk/gui/wato/__init__.py | 2 +-
cmk/gui/werks.py | 2 +-
cmk/structured_data.py | 6 +++---
cmk_base/discovery.py | 2 +-
tests/pylint/pylintrc | 1 -
11 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/checks/apache_status b/checks/apache_status
index 2e58f12..de4f6ef 100644
--- a/checks/apache_status
+++ b/checks/apache_status
@@ -147,11 +147,11 @@ def check_apache_status(item, params, info):
if "Total Accesses" in data_dict:
data_dict["ReqPerSec"] = get_rate("apache_status_%s_accesses"
% item, this_time,
data_dict["Total Accesses"])
- del(data_dict["Total Accesses"])
+ del data_dict["Total Accesses"]
if "Total kBytes" in data_dict:
data_dict["BytesPerSec"] = get_rate("apache_status_%s_bytes"
% item, this_time,
data_dict["Total kBytes"] * 1024)
- del(data_dict["Total kBytes"])
+ del data_dict["Total kBytes"]
data = data_dict.items()
diff --git a/checks/ewon b/checks/ewon
index fec548c..7137f9c 100644
--- a/checks/ewon
+++ b/checks/ewon
@@ -143,7 +143,7 @@ def check_oxyreduct(item, params, parsed):
if "name" in tag_params:
if "condition_flag" in tag_params:
condition_tagid = tagid + tag_params["condition_flag"][0]
- if not (int(parsed[item][condition_tagid]) &
tag_params["condition_flag"][1]):
+ if not int(parsed[item][condition_tagid]) &
tag_params["condition_flag"][1]:
continue
value = int(value)
unit = tag_params.get("unit", "")
diff --git a/checks/f5_bigip_fans b/checks/f5_bigip_fans
index aa80ed7..4eef77c 100644
--- a/checks/f5_bigip_fans
+++ b/checks/f5_bigip_fans
@@ -43,7 +43,7 @@ def f5_bigip_fans_genitem(fanid):
fantype = "Chassis"
else:
fantype = "Unknown"
- return ("%s %d" % (fantype, fanid))
+ return "%s %d" % (fantype, fanid)
def inventory_f5_bigip_fans(info):
diff --git a/checks/h3c_lanswitch_cpu b/checks/h3c_lanswitch_cpu
index 27654d2..c77d729 100644
--- a/checks/h3c_lanswitch_cpu
+++ b/checks/h3c_lanswitch_cpu
@@ -60,7 +60,7 @@ def h3c_lanswitch_cpu_genitem(item):
switchid = 1
cputype = "Unknown"
cpunum = cpuid
- return ("Switch %d %s %d" % (switchid, cputype, cpunum))
+ return "Switch %d %s %d" % (switchid, cputype, cpunum)
def inventory_h3c_lanswitch_cpu(info):
diff --git a/checks/hitachi_hus.include b/checks/hitachi_hus.include
index 5b56882..69362f0 100644
--- a/checks/hitachi_hus.include
+++ b/checks/hitachi_hus.include
@@ -47,8 +47,8 @@
def scan_hitachi_hus(oid):
- return ("hm700" in oid(".1.3.6.1.2.1.1.1.0").lower() or \
- "hm800" in oid(".1.3.6.1.2.1.1.1.0").lower() )
+ return "hm700" in oid(".1.3.6.1.2.1.1.1.0").lower() or \
+ "hm800" in oid(".1.3.6.1.2.1.1.1.0").lower()
def inventory_hitachi_hus(info):
diff --git a/cmk/gui/plugins/visuals/wato.py b/cmk/gui/plugins/visuals/wato.py
index 04fed17..5867434 100644
--- a/cmk/gui/plugins/visuals/wato.py
+++ b/cmk/gui/plugins/visuals/wato.py
@@ -49,7 +49,7 @@ class FilterWatoFile(Filter):
# This filter is also available on slave sites with disabled WATO
# To determine if this site is a slave we check the existance of the
distributed_wato.mk
# file and the absence of any site configuration
- return (config.wato_enabled or watolib.is_wato_slave_site())
+ return config.wato_enabled or watolib.is_wato_slave_site()
def load_wato_data(self):
@@ -83,7 +83,7 @@ class FilterWatoFile(Filter):
subfolder += part
allowed_folders.add(subfolder)
- html.dropdown(self.name, [("", "")] + [ entry for entry in
self.selection if (entry[0] in allowed_folders) ])
+ html.dropdown(self.name, [("", "")] + [ entry for entry in
self.selection if entry[0] in allowed_folders ])
def filter(self, infoname):
self.check_wato_data_update()
diff --git a/cmk/gui/wato/__init__.py b/cmk/gui/wato/__init__.py
index 253f6e9..3973ca3 100644
--- a/cmk/gui/wato/__init__.py
+++ b/cmk/gui/wato/__init__.py
@@ -10842,7 +10842,7 @@ class ModeRoles(RoleManagement, WatoMode):
# Users
table.cell(_("Users"),
HTML(", ").join([ html.render_a(user.get("alias",
user_id), watolib.folder_preserving_link([("mode", "edit_user"),
("edit", user_id)]))
- for (user_id, user) in users.items() if (id in
user["roles"])]))
+ for (user_id, user) in users.items() if id in user["roles"]]))
# Possibly we could also display the following information
diff --git a/cmk/gui/werks.py b/cmk/gui/werks.py
index 123e34d..c5a55eb 100644
--- a/cmk/gui/werks.py
+++ b/cmk/gui/werks.py
@@ -72,7 +72,7 @@ def handle_acknowledgement():
load_werks() # reload ack states after modification
elif html.var("_ack_all"):
- if (html.confirm(_("Do you really want to acknowledge <b>all</b>
incompatible werks?"), method="GET")):
+ if html.confirm(_("Do you really want to acknowledge <b>all</b>
incompatible werks?"), method="GET"):
num = len(unacknowledged_incompatible_werks())
acknowledge_all_werks()
html.message(_("%d incompatible Werks have been acknowledged.") %
num)
diff --git a/cmk/structured_data.py b/cmk/structured_data.py
index 6fb678a..adb7fb9 100644
--- a/cmk/structured_data.py
+++ b/cmk/structured_data.py
@@ -112,7 +112,7 @@ class StructuredDataTree(object):
def _validate_tree_path(self, tree_path):
if not tree_path:
raise MKGeneralException("Empty tree path or zero.")
- if not (isinstance(tree_path, (str, unicode))):
+ if not isinstance(tree_path, (str, unicode)):
raise MKGeneralException("Wrong tree path format. Must be of type
string.")
if not (tree_path.endswith(":") or tree_path.endswith(".")):
raise MKGeneralException("No valid tree path.")
@@ -718,8 +718,8 @@ Format of compared entries:
"""
new_keys = set(new_entries.keys())
old_keys = set(old_entries.keys())
- new = {k: (None, new_entries[k]) for k in (new_keys - old_keys)}
- removed = {k: (old_entries[k], None) for k in (old_keys - new_keys)}
+ new = {k: (None, new_entries[k]) for k in new_keys - old_keys}
+ removed = {k: (old_entries[k], None) for k in old_keys - new_keys}
identical, changed = {}, {}
for k in new_keys.intersection(old_keys):
old_v = old_entries[k]
diff --git a/cmk_base/discovery.py b/cmk_base/discovery.py
index a4940f9..37f0201 100644
--- a/cmk_base/discovery.py
+++ b/cmk_base/discovery.py
@@ -250,7 +250,7 @@ def discover_on_host(mode, hostname, do_snmp_scan, use_caches,
on_error="ignore"
# Note discovered checks that are shadowed by manual checks will vanish
# that way.
- if check_source in ("new"):
+ if check_source == "new":
if mode in ("new", "fixall", "refresh") and
service_filter(hostname, check_plugin_name, item):
counts["added"] += 1
new_items[(check_plugin_name, item)] = paramstring
diff --git a/tests/pylint/pylintrc b/tests/pylint/pylintrc
index a4719e7..769ffa9 100644
--- a/tests/pylint/pylintrc
+++ b/tests/pylint/pylintrc
@@ -45,7 +45,6 @@ disable=
reimported,
relative-import,
singleton-comparison,
- superfluous-parens,
too-few-public-methods,
too-many-ancestors,
too-many-arguments,