Module: check_mk
Branch: master
Commit: 241499ad3b1eef77e897937b841c33fe3b5a396c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=241499ad3b1eef…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Sep 28 12:52:37 2016 +0200
Fixed several unused variables
---
tests/pylint/pylintrc | 3 +++
web/htdocs/htmllib.py | 6 +++---
web/htdocs/login.py | 3 +--
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/tests/pylint/pylintrc b/tests/pylint/pylintrc
index e06c4a9..ac5fefd 100644
--- a/tests/pylint/pylintrc
+++ b/tests/pylint/pylintrc
@@ -19,6 +19,9 @@ disable=C0111,C0326
# unpacking-non-sequence
# Not a problem for us
disable=unsubscriptable-object,unsupported-membership-test,unpacking-non-sequence,assignment-from-none
+# W0612: Unused variable
+# TODO: enable this and prepare code for it!
+#enable=W0612
[TYPECHECK]
# rrdtool
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 1887994..3bad574 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -318,7 +318,7 @@ class html(object):
def all_varnames_with_prefix(self, prefix):
- for varname, value in self.vars.items():
+ for varname in self.vars.keys():
if varname.startswith(prefix):
yield varname
@@ -1833,7 +1833,7 @@ class html(object):
cleared_ids = []
now = time.time()
for valid_id in valid_ids:
- timestamp, rand = valid_id.split("/")
+ timestamp = valid_id.split("/")[0]
if now - int(timestamp) < 86400: # one day
cleared_ids.append(valid_id)
self.save_transids((cleared_ids[-20:] + self.new_transids), unlock = True)
@@ -1869,7 +1869,7 @@ class html(object):
return False
# Normal user/password auth user handling
- timestamp, rand = id.split("/", 1)
+ timestamp = id.split("/", 1)[0]
# If age is too old (one week), it is always
# invalid:
diff --git a/web/htdocs/login.py b/web/htdocs/login.py
index 1664a87..5c1676b 100644
--- a/web/htdocs/login.py
+++ b/web/htdocs/login.py
@@ -260,7 +260,7 @@ def check_auth():
try:
user_id = check_auth_cookie(cookie_name)
break
- except Exception, e:
+ except Exception:
logger(LOG_ERR, 'Exception while checking cookie %s: %s' %
(cookie_name, traceback.format_exc()))
@@ -272,7 +272,6 @@ def check_auth():
def do_login():
# handle the sent login form
- err = None
if html.var('_login'):
try:
username = html.get_unicode_input('_username', '').rstrip()