Module: check_mk
Branch: master
Commit: cb975c8808bbaa51608064451806d5eeed3a886a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cb975c8808bbaa…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Oct 11 14:48:09 2018 +0200
6668 FIX WATO API: fixed broken configuration when setting cluster nodes in
edit_host/add_host API call
Change-Id: I792f6369d6eb15b61bb1646fd3cddd5b3b33bb1e
---
.werks/6668 | 11 +++++++++++
cmk/gui/plugins/webapi/webapi.py | 5 +++++
2 files changed, 16 insertions(+)
diff --git a/.werks/6668 b/.werks/6668
new file mode 100644
index 0000000..fdcf628
--- /dev/null
+++ b/.werks/6668
@@ -0,0 +1,11 @@
+Title: WATO API: fixed broken configuration when setting cluster nodes in
edit_host/add_host API call
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1539262029
+
+
diff --git a/cmk/gui/plugins/webapi/webapi.py b/cmk/gui/plugins/webapi/webapi.py
index efec628..f1b94b2 100644
--- a/cmk/gui/plugins/webapi/webapi.py
+++ b/cmk/gui/plugins/webapi/webapi.py
@@ -267,6 +267,8 @@ class APICallHosts(APICallCollection):
watolib.Folder.create_missing_folders(folder_path)
# Add host
+ if cluster_nodes:
+ cluster_nodes = map(str, cluster_nodes)
watolib.Folder.folder(folder_path).create_hosts([(hostname, attributes,
cluster_nodes)])
@@ -300,6 +302,9 @@ class APICallHosts(APICallCollection):
if not cluster_nodes:
cluster_nodes = host.cluster_nodes()
+ if cluster_nodes:
+ cluster_nodes = map(str, cluster_nodes)
+
host.edit(current_attributes, cluster_nodes)