Module: check_mk
Branch: master
Commit: 0ffbce29fbdd3a1b1f6841b940a0b43e1608e9a9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0ffbce29fbdd3a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Nov 21 00:06:14 2011 +0100
WATO: API updated. api.get_all_hosts(self, folder)
---
web/htdocs/wato.py | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index efa7184..4c9a71d 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9524,10 +9524,12 @@ class API:
g_hooks.setdefault(name, []).append(func)
# Get a (flat) dictionary containing all hosts with their *effective*
- # attributes (containing all inherited and default values where appropriate).
- def get_all_hosts(self):
+ # attributes (containing all inherited and default values where appropriate)
+ # of the given folder. If folder is None, returns all hosts from the root folder
+ # Folder must be returned by get_folder()
+ def get_all_hosts(self, folder=None):
load_all_folders()
- return collect_hosts(g_root_folder)
+ return collect_hosts(folder or g_root_folder)
# Find a folder by its path. Raise an exception if it does
# not exist.