Module: check_mk
Branch: master
Commit: 3a48a4b7b1127f1c1e44a8e49e84500e64a0afc1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3a48a4b7b1127f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 8 13:49:33 2016 +0100
Minor cleanup: Renamed function to something more meaningful
---
modules/automation.py | 2 +-
modules/check_mk.py | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/modules/automation.py b/modules/automation.py
index c54604e..18d7ee0 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -475,7 +475,7 @@ def automation_restart(job = "restart"):
try:
backup_path = None
- if not lock_objects_file():
+ if another_activation_is_in_progress():
raise MKAutomationError("Cannot activate changes. "
"Another activation process is currently in progresss")
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 4e21946..9d98341 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -4127,7 +4127,7 @@ def do_restart(only_reload = False):
try:
backup_path = None
- if not lock_objects_file():
+ if another_activation_is_in_progress():
sys.stderr.write("Other restart currently in progress.
Aborting.\n")
sys.exit(1)
@@ -4178,7 +4178,7 @@ def do_restart(only_reload = False):
sys.exit(1)
restart_lock_fd = None
-def lock_objects_file():
+def another_activation_is_in_progress():
global restart_lock_fd
# In some bizarr cases (as cmk -RR) we need to avoid duplicate locking!
if restart_locking and restart_lock_fd == None:
@@ -4194,8 +4194,8 @@ def lock_objects_file():
fcntl.flock(restart_lock_fd, fcntl.LOCK_EX |
( restart_locking == "abort" and fcntl.LOCK_NB or 0))
except:
- return False
- return True
+ return True
+ return False
def do_donation():