Module: check_mk
Branch: master
Commit: 2690c6bad2d2880206ecfb049f9e9211395dfe7a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2690c6bad2d288…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Sep 26 09:40:17 2018 +0200
6718 FIX Fixed invalid exception handling when unable to initialize the Event Console
When an exception occurs before the configuration was read during initialization
of the Event Console a subsequent exception could occur during shutdown of the
Event Console process. The exception message looked like this:
local variable 'pid_path' referenced before assignment
Change-Id: Ie7f4aabef74eb3e450b5cd2b8ce0572aa5a49e8f
---
.werks/6718 | 15 +++++++++++++++
cmk/ec/main.py | 3 ++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/6718 b/.werks/6718
new file mode 100644
index 0000000..d50da38
--- /dev/null
+++ b/.werks/6718
@@ -0,0 +1,15 @@
+Title: Fixed invalid exception handling when unable to initialize the Event Console
+Level: 1
+Component: ec
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1537947519
+
+When an exception occurs before the configuration was read during initialization
+of the Event Console a subsequent exception could occur during shutdown of the
+Event Console process. The exception message looked like this:
+
+local variable 'pid_path' referenced before assignment
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index 20ab2d7..d5970e0 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -3971,6 +3971,7 @@ def main():
pathlib.Path(cmk.paths.default_config_dir),
sys.argv)
+ pid_path = None
try:
cmk.log.open_log(sys.stderr)
cmk.log.set_verbosity(settings.options.verbosity)
@@ -4072,7 +4073,7 @@ def main():
bail_out(logger, traceback.format_exc())
finally:
- if cmk.store.have_lock(str(pid_path)):
+ if pid_path and cmk.store.have_lock(str(pid_path)):
try:
pid_path.unlink()
except OSError: