aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_shell.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-03-10 12:33:02 +0100
committerKim Alvefur <zash@zash.se>2023-03-10 12:33:02 +0100
commitc425da3c6a74f92bb2ee30ac1caeff7312f1b8bd (patch)
tree83dcfb686967fd4686b55ee237ffbd5e1ec01112 /plugins/mod_admin_shell.lua
parent4fa75289f6ab1cb49544da9ebd7103c76674fe97 (diff)
downloadprosody-c425da3c6a74f92bb2ee30ac1caeff7312f1b8bd.tar.gz
prosody-c425da3c6a74f92bb2ee30ac1caeff7312f1b8bd.zip
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.
Diffstat (limited to 'plugins/mod_admin_shell.lua')
-rw-r--r--plugins/mod_admin_shell.lua11
1 files changed, 9 insertions, 2 deletions
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