Module: check_mk
Branch: master
Commit: 36293d8bd4225b4512df8a4d61f68d567623ab45
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=36293d8bd4225b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Apr 9 16:32:54 2015 +0200
Fix exception in TimeRange ValueSpec for old PNP timeranges
---
web/htdocs/valuespec.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index d12bd44..ba7e31e 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -2200,6 +2200,16 @@ class Timerange(CascadingDropdown):
if rangespec == None:
rangespec = "4h"
+ # Compatibility with previous versions
+ elif rangespec[0] == "pnp_view":
+ rangespec = {
+ 1: "4h",
+ 2: "25h",
+ 3: "7d",
+ 4: "31d",
+ 5: "365d"
+ }.get(rangespec[1], "4h")
+
now = time.time()
if rangespec[0] == 'age':
from_time = now - rangespec[1]
@@ -2260,6 +2270,7 @@ class Timerange(CascadingDropdown):
return (from_time, now), titles[0]
else: # last (previous)
+ html.debug("HIRN", rangespec)
if rangespec[0] == 'd':
return (from_time - 86400, from_time), titles[1]
elif rangespec[0] == 'w':