# HG changeset patch # User Waqas Hussain # Date 1250580942 -18000 # Node ID af89f646200f83db5529feec8cf534bcf1ee6c75 # Parent f1783e621a36a652a7d1b21aca74c13e14eba507 modulemanager: Added module API function to get all items for a given host based on a key diff -r f1783e621a36 -r af89f646200f core/modulemanager.lua --- a/core/modulemanager.lua Tue Aug 18 12:34:59 2009 +0500 +++ b/core/modulemanager.lua Tue Aug 18 12:35:42 2009 +0500 @@ -443,6 +443,19 @@ end end +function api:get_host_items(key) + local result = {}; + for mod_name, module in pairs(modulemap[self.host]) do + module = module.module; + if module.items then + for _, item in ipairs(module.items[key] or NULL) do + t_insert(result, item); + end + end + end + return result; +end + -------------------------------------------------------------------- local actions = {};