Module: check_mk
Branch: master
Commit: 436e00bbc062f144fb806175bfef6c9010c6a22e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=436e00bbc062f1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jan 17 09:05:34 2014 +0100
FIX Creating WATO lock during automations (like e.g. master to slave syncs)
All actions within WATO which might modify config files are globally locked.
This prevents mixups in written files. Only the automation commands did not
use a lock which might lead into broken files when some manual action
and some pushed snapshot wrote a file at the same time. The automations
now use the same lock as user actions which should prevent such problems now.
---
.werks/433 | 14 ++++++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 6 ++++++
3 files changed, 21 insertions(+)
diff --git a/.werks/433 b/.werks/433
new file mode 100644
index 0000000..078ee96
--- /dev/null
+++ b/.werks/433
@@ -0,0 +1,14 @@
+Title: Creating WATO lock during automations (like e.g. master to slave syncs)
+Level: 1
+Component: wato
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1389945767
+
+All actions within WATO which might modify config files are globally locked.
+This prevents mixups in written files. Only the automation commands did not
+use a lock which might lead into broken files when some manual action
+and some pushed snapshot wrote a file at the same time. The automations
+now use the same lock as user actions which should prevent such problems now.
+
diff --git a/ChangeLog b/ChangeLog
index b853da9..9e7f64d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -181,6 +181,7 @@
* 0252 FIX: ESX vSphere configuration: Fixed non-working configuration parameters...
* 0456 FIX: Column was too short...
* 0256 FIX: wato snapshots: snapshot restore no longer fails with older python
versions...
+ * 0433 FIX: Creating WATO lock during automations (like e.g. master to slave
syncs)...
Notifications:
* 0362 sms: now searching PATH for sendsms and smssend commands...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 37e16bd..284fab3 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -8676,6 +8676,12 @@ def page_automation():
if secret != get_login_secret():
raise MKAuthException(_("Invalid automation secret."))
+ # To prevent mixups in written files we use the same lock here as for
+ # the normal WATO page processing. This might not be needed for some
+ # special automation requests, like inventory e.g., but to keep it simple,
+ # we request the lock in all cases.
+ lock_exclusive()
+
# Initialise g_root_folder, load all folder information
prepare_folder_info()