Module: check_mk
Branch: master
Commit: 52edcd96dbd49a7dc2b0357a1e0f0db916e2c90a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=52edcd96dbd49a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Oct 12 15:04:38 2018 +0200
6783 FIX Fixed audit log not showing todays entries when "current date" is
selected
The audit log of WATO shows the entries of the "current date" by default. In
some
cases it could happen that the entries of the current day were not shown by default.
The page displayed yesterdays entries instead.
Workaround: Selecting todays date below the option "Start log from" shows the
current
entries.
Change-Id: Ie51259c2bfd146d648670d85e64b2beb78536419
---
.werks/6783 | 16 ++++++++++++++++
cmk/gui/wato/pages/audit_log.py | 3 ++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/.werks/6783 b/.werks/6783
new file mode 100644
index 0000000..88489d2
--- /dev/null
+++ b/.werks/6783
@@ -0,0 +1,16 @@
+Title: Fixed audit log not showing todays entries when "current date" is
selected
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1538594395
+
+The audit log of WATO shows the entries of the "current date" by default. In
some
+cases it could happen that the entries of the current day were not shown by default.
+The page displayed yesterdays entries instead.
+
+Workaround: Selecting todays date below the option "Start log from" shows the
current
+entries.
diff --git a/cmk/gui/wato/pages/audit_log.py b/cmk/gui/wato/pages/audit_log.py
index 1a65768..985a9be 100644
--- a/cmk/gui/wato/pages/audit_log.py
+++ b/cmk/gui/wato/pages/audit_log.py
@@ -176,7 +176,8 @@ class ModeAuditLog(WatoMode):
def _get_start_date(self):
if self._options["start"] == "now":
- return int(time.time()) / 86400 * 86400
+ st = time.localtime()
+ return int(time.mktime(time.struct_time((st.tm_year, st.tm_mon, st.tm_mday,
0, 0, 0, 0, 0, 0))))
return int(self._options["start"][1])