[checkmk-commits] Check_MK Git: check_mk: webapi: fixed bug, now able to add a host into the main directory

Andreas Boesl ab at mathias-kettner.de
Tue Aug 19 12:00:59 CEST 2014


Module: check_mk
Branch: master
Commit: 1ebf0719cf3f181ae982b05c8ac7703d46f33f0a
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1ebf0719cf3f181ae982b05c8ac7703d46f33f0a

Author: Andreas Boesl <ab at mathias-kettner.de>
Date:   Tue Aug 19 12:00:28 2014 +0200

webapi: fixed bug, now able to add a host into the main directory

---

 web/htdocs/wato.py |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 1042f73..4050657 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -16913,9 +16913,11 @@ class API:
         if "foldername" in validate:
             if not os.path.exists(host_foldername) and not create_folders:
                 raise MKUserError(None, _("Folder does not exist and no permission to create folders"))
-            host_folder_tokens = host_foldername.split("/")
-            for dir_token in host_folder_tokens:
-                check_wato_foldername(None, dir_token, just_name = True)
+
+            if host_foldername != "":
+                host_folder_tokens = host_foldername.split("/")
+                for dir_token in host_folder_tokens:
+                    check_wato_foldername(None, dir_token, just_name = True)
 
         if "host_exists" in validate:
             if hostname in all_hosts:



More information about the checkmk-commits mailing list