Module: check_mk
Branch: master
Commit: ca55d2acb8cdf86bee6df221134971a56a2d6406
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ca55d2acb8cdf8…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Mar 9 15:58:24 2016 +0100
3005 FIX webapi: now able to add new hosts to main folder (bug was introduced recently)
---
.werks/3005 | 9 +++++++++
ChangeLog | 1 +
web/plugins/webapi/webapi.py | 5 +++--
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.werks/3005 b/.werks/3005
new file mode 100644
index 0000000..7bfb846
--- /dev/null
+++ b/.werks/3005
@@ -0,0 +1,9 @@
+Title: webapi: now able to add new hosts to main folder (bug was introduced recently)
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.9i1
+Date: 1457535465
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 31bc0ae..688a29c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -115,6 +115,7 @@
* 3280 FIX: Fixed too often executed network scans...
* 3281 FIX: Fixed network scan overwriting folder modifications made during the scan
* 3282 FIX: Fixed missing validation of network scan properties...
+ * 3005 FIX: webapi: now able to add new hosts to main folder (bug was introduced
recently)
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/plugins/webapi/webapi.py b/web/plugins/webapi/webapi.py
index a488f70..bbb2ff3 100644
--- a/web/plugins/webapi/webapi.py
+++ b/web/plugins/webapi/webapi.py
@@ -84,8 +84,9 @@ def action_add_host(request):
if folder_path == None:
raise MKUserError(None, _("Foldername is missing"))
folders = folder_path.split("/")
- for foldername in folders:
- check_wato_foldername(None, foldername, just_name = True)
+ if folders != [ "" ]:
+ for foldername in folders:
+ check_wato_foldername(None, foldername, just_name = True)
# Validate and cleanup given attributes
# CLEANUP: modify WebAPI .nodes argument