Module: check_mk
Branch: master
Commit: cbfae370aef524607244d49b8a16dbdd1e408f69
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cbfae370aef524…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Apr 18 13:33:57 2018 +0200
5799 FIX Availability: Fixed error in duration computation when merging identical states
This error appears when the availability timeline is not fully connect, e.g. if it is
split
by a service period. The computation error itself seems no big issue, since this
incorrect
computed value wasn't evaluated, anyway.
Change-Id: I5a1976edb1569d36012013ca60093b54bb49b5f1
---
.werks/5799 | 13 +++++++++++++
web/htdocs/availability.py | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/5799 b/.werks/5799
new file mode 100644
index 0000000..57a22fe
--- /dev/null
+++ b/.werks/5799
@@ -0,0 +1,13 @@
+Title: Availability: Fixed error in duration computation when merging identical states
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1524050943
+Class: fix
+
+This error appears when the availability timeline is not fully connect, e.g. if it is
split
+by a service period. The computation error itself seems no big issue, since this
incorrect
+computed value wasn't evaluated, anyway.
+
diff --git a/web/htdocs/availability.py b/web/htdocs/availability.py
index 3c9510c..b9ffaaf 100644
--- a/web/htdocs/availability.py
+++ b/web/htdocs/availability.py
@@ -1077,7 +1077,7 @@ def object_title(what, av_entry):
def merge_timeline(entries):
n = 1
while n < len(entries):
- if entries[n][1] == entries[n-1][1]:
+ if entries[n][1] == entries[n-1][1] and entries[n][0]["from"] ==
entries[n-1][0]["until"]:
entries[n-1][0]["duration"] += entries[n][0]["duration"]
entries[n-1][0]["until"] = entries[n][0]["until"]
del entries[n]