Module: check_mk
Branch: master
Commit: c0a991f33db64fea3b2c511e9604eca91788860c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c0a991f33db64f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Apr 8 09:03:03 2016 +0200
Remove file race condition when saving annotations
---
web/htdocs/availability.py | 4 +++-
web/plugins/views/availability.py | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/availability.py b/web/htdocs/availability.py
index 5e0f654..6b94c39 100644
--- a/web/htdocs/availability.py
+++ b/web/htdocs/availability.py
@@ -955,7 +955,9 @@ def melt_short_intervals(entries, duration, dont_merge):
def save_annotations(annotations):
- file(defaults.var_dir + "/availability_annotations.mk", "w").write(repr(annotations) + "\n")
+ path = defaults.var_dir + "/availability_annotations.mk"
+ file(path + ".new", "w").write(repr(annotations) + "\n")
+ os.rename(path + ".new", path)
def load_annotations(lock = False):
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index 4780b80..fbe2d46 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -28,8 +28,6 @@
#
# - Host-Downtimes müssen auch auf Services wirken
# - Test mit Hosts und BI-Aggregaten
-# - Wenn man Reload macht nach dem Speichern in einer Annotation, landet man
-# wieder in der Maske.
# - Wenn man eine Annotation gelöscht hat, braucht man erst einen Reload,
# damit die Zeitleiste korrekt dargestellt wird. Anscheinend haben wir
# hier ein Reihenfolgenproblem.
@@ -726,6 +724,7 @@ def edit_annotation():
# Called at the beginning of every availability page
def handle_delete_annotations():
+ html.debug(u"Ich lösche")
if html.var("_delete_annotation"):
site_id = html.var("anno_site") or ""
hostname = html.var("anno_host")
@@ -745,6 +744,7 @@ def handle_delete_annotations():
availability.delete_annotation(annotations, site_host_svc, fromtime, untiltime)
availability.save_annotations(annotations)
+
def handle_edit_annotations():
# Avoid reshowing edit form after edit and reload
if html.is_transaction() and not html.transaction_valid():
Module: check_mk
Branch: master
Commit: 3c8e391bea4a8bd95770af029c14fe9fbe76b3d4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3c8e391bea4a8b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Apr 8 09:11:52 2016 +0200
Deleting annotations takes place at correct time
---
web/plugins/views/availability.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index fbe2d46..9da5b5e 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -28,9 +28,6 @@
#
# - Host-Downtimes müssen auch auf Services wirken
# - Test mit Hosts und BI-Aggregaten
-# - Wenn man eine Annotation gelöscht hat, braucht man erst einen Reload,
-# damit die Zeitleiste korrekt dargestellt wird. Anscheinend haben wir
-# hier ein Reihenfolgenproblem.
import availability, table
@@ -193,6 +190,12 @@ def render_availability_page(view, datasource, filterheaders, display_options, o
av_object = None
title += view_title(view)
+ # Deletion must take place before computation, since it affects the outcome
+ html.plug()
+ handle_delete_annotations()
+ confirmation_html_code = html.drain()
+ html.unplug()
+
# Now compute all data, we need this also for CSV export
if not html.has_user_errors():
av_rawdata = availability.get_availability_rawdata(what, filterheaders, only_sites,
@@ -211,7 +214,8 @@ def render_availability_page(view, datasource, filterheaders, display_options, o
if 'T' in display_options:
html.top_heading(title)
- handle_delete_annotations()
+ html.write(confirmation_html_code)
+
# Remove variables for editing annotations, otherwise they will make it into the uris
html.del_all_vars("editanno_")
@@ -724,7 +728,6 @@ def edit_annotation():
# Called at the beginning of every availability page
def handle_delete_annotations():
- html.debug(u"Ich lösche")
if html.var("_delete_annotation"):
site_id = html.var("anno_site") or ""
hostname = html.var("anno_host")
Module: check_mk
Branch: master
Commit: e84d047c40d0ad4659064e7c52dc699d259382f4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e84d047c40d0ad…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Apr 8 08:33:18 2016 +0200
Removed bogus comment
---
web/htdocs/availability.py | 7 -------
1 file changed, 7 deletions(-)
diff --git a/web/htdocs/availability.py b/web/htdocs/availability.py
index ba6bce2..158c706 100644
--- a/web/htdocs/availability.py
+++ b/web/htdocs/availability.py
@@ -24,13 +24,6 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-#### TODO: Jetzt noch die Timeline, die *nicht* inline ist. Dazu der
-#### choords ergänzen. Die render_timeline() Funktion malt aber ja
-#### auch noch die Tabelle mit Hovercode und noch was was ich vergessen
-#### habe. Auch die Tabelle muss formalisiert erzeugt werden. Dann
-#### die Möglichkeit "All Timelines" schaffen und diese dann 1:1 im
-#### Reporting abbilden.
-
import bi, views, visuals
import sites
# TODO: Get rid of import of views
Module: check_mk
Branch: master
Commit: 4044478628949f2b8621c3bcec3ff6bcb4687dc9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4044478628949f…
Author: Sven Rueß <sr(a)mathias-kettner.de>
Date: Thu Apr 7 19:27:23 2016 +0200
new bug related to wato folders and contact group names
---
.bugs/2493 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.bugs/2493 b/.bugs/2493
new file mode 100644
index 0000000..5842a7e
--- /dev/null
+++ b/.bugs/2493
@@ -0,0 +1,9 @@
+Title: Contact group name is not stripped at WATO folders
+Component: wato
+State: open
+Date: 2016-04-07 19:23:35
+Targetversion: 1.2.8
+Class: bug
+
+Long names of contact groups are not stripped at WATo folders. The name is displayed over the size of the folder.
+It looks not very nice.