Module: check_mk
Branch: master
Commit: c2aa9ce685d8ba5c6bfdda1830acfdf8994aa6ec
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c2aa9ce685d8ba…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 22 16:56:43 2019 +0100
Fixed compatibility to 1.5 liveproxy "connect to local unix socket" config
Change-Id: Ia3aeb792d5f7ac1478fb64928fbfb3588e21901b
---
cmk/gui/config.py | 8 ++++++++
tests/unit/cmk/gui/test_gui_config.py | 9 +++++++++
2 files changed, 17 insertions(+)
diff --git a/cmk/gui/config.py b/cmk/gui/config.py
index c17b6bd..436ae7d 100644
--- a/cmk/gui/config.py
+++ b/cmk/gui/config.py
@@ -795,6 +795,14 @@ def migrate_old_site_config(site_config):
continue
socket = site_cfg["socket"]
+
+ # Same as above for liveproxy configs
+ if isinstance(socket, tuple) and socket[0] == "proxy":
+ proxy_cfg = socket[1]
+ if proxy_cfg.get("socket") is None:
+ proxy_cfg["socket"] = ("local", None)
+ continue
+
if socket == 'disabled':
site_cfg['disabled'] = True
site_cfg['socket'] = ("local", None)
diff --git a/tests/unit/cmk/gui/test_gui_config.py
b/tests/unit/cmk/gui/test_gui_config.py
index f0e8a38..f3eb9e2 100644
--- a/tests/unit/cmk/gui/test_gui_config.py
+++ b/tests/unit/cmk/gui/test_gui_config.py
@@ -607,6 +607,15 @@ def test_permission_sorting(do_sort, result):
"address": ("::1", 1234)
})
}),
+ ({
+ "socket": ("proxy", {
+ "socket": None,
+ })
+ }, {
+ "socket": ("proxy", {
+ "socket": ("local", None),
+ })
+ }),
# Is allowed in 1.6 and should not be converted
({
"socket": ("proxy", {