Module: check_mk
Branch: master
Commit: 88d5ac8cf9b6e9986b190e4817dfdc2bae703d1d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=88d5ac8cf9b6e9…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jul 4 14:31:52 2016 +0200
aquire_lock: now return True if lock was already held
---
web/htdocs/lib.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index 7b76b6d..3acae6b 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -388,7 +388,7 @@ g_aquired_locks = []
g_locked_paths = []
def aquire_lock(path):
if path in g_locked_paths:
- return # No recursive locking
+ return True # No recursive locking
# Create file (and base dir) for locking if not existant yet
make_nagios_directory(os.path.dirname(path))
@@ -408,6 +408,7 @@ def aquire_lock(path):
g_aquired_locks.append((path, fd))
g_locked_paths.append(path)
+
def release_lock(path):
if path not in g_locked_paths:
return # no unlocking needed