Module: check_mk
Branch: master
Commit: 9eee0248dd3735039ceea0a5c91d78b09dd23cbe
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9eee0248dd3735…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Jul 4 13:38:24 2018 +0200
Simplification: No need to redefine defaults.
Change-Id: Id97e75d76fb27766a6a9dd3f1a799a8ae2caa8d8
---
tests/pylint/pylintrc | 8 --------
1 file changed, 8 deletions(-)
diff --git a/tests/pylint/pylintrc b/tests/pylint/pylintrc
index 0e5e51f..348ab9d 100644
--- a/tests/pylint/pylintrc
+++ b/tests/pylint/pylintrc
@@ -111,15 +111,7 @@ msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
[FORMAT]
max-line-length=100
-single-line-if-stmt=no
-indent-string=' '
[VARIABLES]
-# Ignore these unused variables (e.g. _no_item,_no_params)
-dummy-variables-rgx=^_.*
# Needed by web code because of super globals. TODO Clean this up some day
additional-builtins=html,_,_u,current_language,HTML
-
-[MISCELLANEOUS]
-# List of note tags to take in consideration, separated by a comma.
-notes=FIXME,TODO
Module: check_mk
Branch: master
Commit: eca1b2156ebd9b021d9808e85e8723e57c9faeeb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eca1b2156ebd9b…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Jul 4 11:02:51 2018 +0200
Fixed and enabled keyword-arg-before-vararg warnings.
Note that there was actually no way to pass "enabled" as a keyword argument
and pass extra positional arguments as well. So Profile.__init__'s
signature didn't make sense, but the fix was easy: Just remove positional
arguments. The same holds for ImageUpload.__init__.
CMKWebLogger.exception is a different story: Its signature differs from the
one of the superclass method, which is ugly and a design no-no. Rather than
fixing all the call sites, we introduce some local Kung Fu...
Change-Id: Ic9a09d40491ef224073056ca8192d2c10cdb8669
---
cmk/profile.py | 5 ++---
tests/pylint/pylintrc | 1 -
web/htdocs/log.py | 14 +++++++++++---
web/htdocs/valuespec.py | 4 ++--
4 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/cmk/profile.py b/cmk/profile.py
index 39e9918..062a03b 100644
--- a/cmk/profile.py
+++ b/cmk/profile.py
@@ -36,10 +36,9 @@ import cmk.log
class Profile(object):
- def __init__(self, enabled=True, profile_file=None, *args, **kwargs):
+ def __init__(self, enabled=True, profile_file=None, **kwargs):
self._enabled = enabled
self._profile_file = profile_file
- self._args = args
self._kwargs = kwargs
self._profile = None
@@ -47,7 +46,7 @@ class Profile(object):
def __enter__(self):
if self._enabled:
cmk.log.logger.info("Recording profile")
- self._profile = cProfile.Profile(*self._args, **self._kwargs)
+ self._profile = cProfile.Profile(**self._kwargs)
self._profile.enable()
return self
diff --git a/tests/pylint/pylintrc b/tests/pylint/pylintrc
index 7359868..0e5e51f 100644
--- a/tests/pylint/pylintrc
+++ b/tests/pylint/pylintrc
@@ -39,7 +39,6 @@ disable=
global-variable-undefined,
inconsistent-return-statements,
invalid-name,
- keyword-arg-before-vararg,
len-as-condition,
line-too-long,
logging-not-lazy,
diff --git a/web/htdocs/log.py b/web/htdocs/log.py
index 18a5ac9..ce21647 100644
--- a/web/htdocs/log.py
+++ b/web/htdocs/log.py
@@ -31,13 +31,21 @@ import cmk.log
import cmk.paths
class CMKWebLogger(_logging.getLoggerClass()):
- def exception(self, msg=None, *args, **kwargs):
+ def exception(self, *args, **kwargs):
"""Logs an optional message together with the traceback of the
last exception to the current logger (-> web.log)"""
- if msg is None:
+ # FIXME: Ugly Kung Fu to make the msg positional argument optional. This
+ # is a consequence of the cruel hack to change exceptions's signature,
+ # something which we shouldn't do: Either fix all the call sites or
+ # introduce another method.
+ if args:
+ msg = args[0]
+ args = args[1:]
+ else:
msg = _('Internal error')
+ msg = kwargs.pop('msg', msg)
- super(CMKWebLogger, self).exception("%s %s" % (html.request_uri(), msg))
+ super(CMKWebLogger, self).exception("%s %s" % (html.request_uri(), msg), *args, **kwargs)
_logging.setLoggerClass(CMKWebLogger)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index c24d6e3..715320f 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -4026,10 +4026,10 @@ class FileUpload(ValueSpec):
class ImageUpload(FileUpload):
- def __init__(self, max_size=None, show_current_image=False, *args, **kwargs):
+ def __init__(self, max_size=None, show_current_image=False, **kwargs):
self._max_size = max_size
self._show_current_image = show_current_image
- FileUpload.__init__(self, *args, **kwargs)
+ FileUpload.__init__(self, **kwargs)
def render_input(self, varprefix, value):
Module: check_mk
Branch: master
Commit: dfa82bf2361bce571364b22b24f4ea0455262bc7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dfa82bf2361bce…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Jul 4 10:14:04 2018 +0200
Fixed and enabled anomalous-unicode-escape-in-string warnings.
Change-Id: Ide21bfcb022755e5ba9fa2790d8660ef42165b23
---
tests/pylint/pylintrc | 1 -
web/plugins/wato/check_parameters.py | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/tests/pylint/pylintrc b/tests/pylint/pylintrc
index f011c03..7359868 100644
--- a/tests/pylint/pylintrc
+++ b/tests/pylint/pylintrc
@@ -13,7 +13,6 @@ persistent=yes
[MESSAGES CONTROL]
disable=
abstract-method,
- anomalous-unicode-escape-in-string,
arguments-differ,
attribute-defined-outside-init,
bad-classmethod-argument,
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 743b41f..a470c6c 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1494,7 +1494,7 @@ register_rule(group + '/' + subgroup_inventory,
'name will be hardcoded into the check. In that case if you put %u into the service description, that will be replaced '
'by the actual user name during inventory. You need that if your rule might match for more than one user - your would '
'create duplicate services with the same description otherwise.</p><p>Windows users are specified by the namespace followed by '
- 'the actual user name. For example "\\\\NT AUTHORITY\NETWORK SERVICE" or "\\\\CHKMKTEST\\Administrator".</p>'),
+ 'the actual user name. For example "\\\\NT AUTHORITY\\NETWORK SERVICE" or "\\\\CHKMKTEST\\Administrator".</p>'),
)),
('icon', UserIconOrAction(
title = _("Add custom icon or action"),
Module: check_mk
Branch: master
Commit: 0265d8ec41707e9abd3eb266865129662875995f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0265d8ec41707e…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed Jul 4 09:30:49 2018 +0200
Fixed and enabled anomalous-backslash-in-string warnings.
Change-Id: I1a08a576fb37c43ff290003c2c702344b6d2a09c
---
tests/pylint/pylintrc | 1 -
web/htdocs/htmllib.py | 8 ++++++--
web/htdocs/views.py | 2 +-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/tests/pylint/pylintrc b/tests/pylint/pylintrc
index 41f0516..f011c03 100644
--- a/tests/pylint/pylintrc
+++ b/tests/pylint/pylintrc
@@ -14,7 +14,6 @@ persistent=yes
disable=
abstract-method,
anomalous-unicode-escape-in-string,
- anomalous-backslash-in-string,
arguments-differ,
attribute-defined-outside-init,
bad-classmethod-argument,
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index b1e595c..f6d7430 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1183,8 +1183,12 @@ class RequestHandler(object):
self.listvars = {} # for variables with more than one occurrance
self.uploads = {}
- # TODO: Fix this regex. +-\ selects all from + to \, not +, - and \!
- varname_regex = re.compile('^[\w\d_.%+-\\\*]+$')
+ # TODO: Previously the regex below matched any alphanumeric character plus any character
+ # from set(r'%*+,-./:;<=>?@[\_'), but this was very probably unintended. Now we only allow
+ # alphanumeric characters plus any character from set('%*+-._'), which is probably still a
+ # bit too broad. We should really figure out what we need and make sure that we only use
+ # that restricted set.
+ varname_regex = re.compile(r'^[\w.%*+-]+$')
for field in fields.list:
varname = field.name
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 58eb554..bc4dfe8 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -3227,7 +3227,7 @@ def format_plugin_output(output, row = None):
if shall_escape:
# (?:<A HREF="), (?: target="_blank">)? and endswith(" </A>") is a special
# handling for the HTML code produced by check_http when "clickable URL" option is active.
- output = re.sub("(?:<A HREF=")?(http[s]?://[^\"'>\t\s\n,]+)(?: target="_blank">)?",
+ output = re.sub("(?:<A HREF=")?(http[s]?://[^\"'>\\s,]+)(?: target="_blank">)?",
lambda p: '<a href="%s"><img class=pluginurl align=absmiddle title="%s" src="images/pluginurl.png"></a>' %
(p.group(1).replace('"', ''), p.group(1).replace('"', '')), output)
Module: check_mk
Branch: master
Commit: f4edc31d22403a75701c9f845b03bfa186b8a520
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f4edc31d22403a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 3 20:15:14 2018 +0200
6324 FIX Notifications: Fixed height of graph area with a larger legend
Graphs with a lot of metrics need more space for their legend. This larger
legend did not increase the size of the graph images. They reduced the size
of the graph are and finally destroyed the graph layout.
The image height is now increased with a larger number of metrics.
Change-Id: I44b06be464283e7a25a2c48ff2eac6a5e04764d5
---
.werks/6324 | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/.werks/6324 b/.werks/6324
new file mode 100644
index 0000000..3342827
--- /dev/null
+++ b/.werks/6324
@@ -0,0 +1,15 @@
+Title: Notifications: Fixed height of graph area with a larger legend
+Level: 1
+Component: metrics
+Class: fix
+Compatible: compat
+Edition: cee
+State: unknown
+Version: 1.6.0i1
+Date: 1530641604
+
+Graphs with a lot of metrics need more space for their legend. This larger
+legend did not increase the size of the graph images. They reduced the size
+of the graph are and finally destroyed the graph layout.
+
+The image height is now increased with a larger number of metrics.
Module: check_mk
Branch: master
Commit: deaaa414e909904163d1a834793c8aecd6c2b172
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=deaaa414e90990…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 3 20:03:35 2018 +0200
6323 FIX Fixed graph PNG export of other than first graphs
When using the PNG export of a graph (e.g. from the context menu of a graph),
only the export of the first graph of a host/service was working. Other graphs
produced an error message.
Change-Id: I46a8af9401c2f49f7f9e32f09ceaf8e9b0c99614
---
.werks/6323 | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/.werks/6323 b/.werks/6323
new file mode 100644
index 0000000..4eb7fec
--- /dev/null
+++ b/.werks/6323
@@ -0,0 +1,13 @@
+Title: Fixed graph PNG export of other than first graphs
+Level: 1
+Component: metrics
+Class: fix
+Compatible: compat
+Edition: cee
+State: unknown
+Version: 1.6.0i1
+Date: 1530640853
+
+When using the PNG export of a graph (e.g. from the context menu of a graph),
+only the export of the first graph of a host/service was working. Other graphs
+produced an error message.