Module: check_mk
Branch: master
Commit: 64d4810d8a66956e988af2ae4fe0672a2a9e9471
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=64d4810d8a6695…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Jul 13 09:54:43 2018 +0200
Fixed and enabled misplaced-comparison-constant warnings.
Change-Id: I23726a86e32bf83e4572bde09318bfb0308e2a57
---
cmk/gui/mkeventd.py | 6 +++---
cmk/gui/wato/__init__.py | 6 +++---
tests/pylint/pylintrc | 3 +--
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/cmk/gui/mkeventd.py b/cmk/gui/mkeventd.py
index 2698dc0..6438d3d 100644
--- a/cmk/gui/mkeventd.py
+++ b/cmk/gui/mkeventd.py
@@ -315,13 +315,13 @@ def event_rule_matches(rule_pack, rule, event):
def event_rule_matches_non_inverted(rule_pack, rule, event):
- if False == match_ipv4_network(rule.get("match_ipaddress",
"0.0.0.0/0"), event["ipaddress"]):
+ if match_ipv4_network(rule.get("match_ipaddress", "0.0.0.0/0"),
event["ipaddress"]) == False:
return _("The source IP address does not match.")
- if False == match(rule.get("match_host"), event["host"],
complete=True):
+ if match(rule.get("match_host"), event["host"], complete=True) ==
False:
return _("The host name does not match.")
- if False == match(rule.get("match_application"),
event["application"], complete=False):
+ if match(rule.get("match_application"), event["application"],
complete=False) == False:
return _("The application (syslog tag) does not match")
if "match_facility" in rule and event["facility"] !=
rule["match_facility"]:
diff --git a/cmk/gui/wato/__init__.py b/cmk/gui/wato/__init__.py
index 153d5ab..3ff0bef 100644
--- a/cmk/gui/wato/__init__.py
+++ b/cmk/gui/wato/__init__.py
@@ -432,7 +432,7 @@ def page_handler():
target = target()
if not target:
continue
- if '/' == target[0] or target.startswith('../') or
'://' in target:
+ if target[0] == '/' or target.startswith('../') or
'://' in target:
html.context_button(buttontext, target)
else:
html.context_button(buttontext,
watolib.folder_preserving_link([("mode", target)]))
@@ -10101,8 +10101,8 @@ class ModeUsers(WatoMode):
html.i(_("not a contact"))
elif not user.get("notifications_enabled", True):
html.write_text(_("disabled"))
- elif "" == user.get("host_notification_options",
"") \
- and "" ==
user.get("service_notification_options", ""):
+ elif user.get("host_notification_options", "") ==
"" and \
+ user.get("service_notification_options", "") ==
"":
html.write_text(_("all events disabled"))
else:
tp = user.get("notification_period", "24X7")
diff --git a/tests/pylint/pylintrc b/tests/pylint/pylintrc
index 6abeb1e..5ce8339 100644
--- a/tests/pylint/pylintrc
+++ b/tests/pylint/pylintrc
@@ -77,9 +77,8 @@ disable=
wrong-import-order,
wrong-import-position,
#---------------------------------------------------------------------------
- # The 6 warnings below have already been fixed for non-web/ code. When the
+ # The 5 warnings below have already been fixed for non-web/ code. When the
# upcoming reorganization of web/ has been landed, these should be fixed first.
- misplaced-comparison-constant,
old-style-class,
simplifiable-if-statement,
unnecessary-lambda,