Module: check_mk
Branch: master
Commit: 780778cb39150636ba2c7768d22ea704478c6c54
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=780778cb391506…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu May 18 11:28:20 2017 +0200
Set default values of recently changed API calls
Change-Id: I0394813fd0488bb8a6f83df45714de11bbc3a93c
---
web/plugins/webapi/webapi.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/web/plugins/webapi/webapi.py b/web/plugins/webapi/webapi.py
index 1674cca..cae9ff3 100644
--- a/web/plugins/webapi/webapi.py
+++ b/web/plugins/webapi/webapi.py
@@ -108,7 +108,7 @@ def action_add_host(request):
validate_request_keys(request, required_keys=["hostname",
"folder"],
optional_keys=["attributes",
"nodes", "create_folders"])
- create_folders = int(request.get("create_folders")) == 1
+ create_folders = int(request.get("create_folders", "1")) == 1
hostname = request.get("hostname")
folder_path = request.get("folder")
@@ -199,7 +199,7 @@ def action_get_host(request):
host = Host.host(hostname)
host.need_permission("read")
- if int(request.get("effective_attributes")) == 1:
+ if int(request.get("effective_attributes", "0")) == 1:
attributes = host.effective_attributes()
else:
attributes = host.attributes()
@@ -219,7 +219,7 @@ api_actions["get_host"] = {
def action_get_all_hosts(request):
validate_request_keys(request, optional_keys=["effective_attributes"])
- effective_attributes = int(request.get("effective_attributes")) == 1
+ effective_attributes = int(request.get("effective_attributes",
"0")) == 1
response = {}
all_hosts = Folder.root_folder().all_hosts_recursively()