From c425da3c6a74f92bb2ee30ac1caeff7312f1b8bd Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 10 Mar 2023 12:33:02 +0100 Subject: mod_admin_shell: Limit module dependency listings to loaded on current host E.g. module:info("http") with many http modules loaded would show a lot of duplication, as each module would be listed for each host, even if not actually enabled on that host. --- plugins/mod_admin_shell.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'plugins/mod_admin_shell.lua') diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index 1b11bf52..c05c227f 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -572,13 +572,20 @@ function def_env.module:info(name, hosts) if mod.module.dependencies and next(mod.module.dependencies) ~= nil then print(" dependencies:"); for dep in pairs(mod.module.dependencies) do - print(" - mod_" .. dep); + -- Dependencies are per module instance, not per host, so dependencies + -- of/on global modules may list modules not actually loaded on the + -- current host. + if modulemanager.is_loaded(host, dep) then + print(" - mod_" .. dep); + end end end if mod.module.reverse_dependencies and next(mod.module.reverse_dependencies) ~= nil then print(" reverse dependencies:"); for dep in pairs(mod.module.reverse_dependencies) do - print(" - mod_" .. dep); + if modulemanager.is_loaded(host, dep) then + print(" - mod_" .. dep); + end end end end -- cgit v1.2.3