Changeset

11604:7466bf65d7c8

mod_admin_shell: module:info: Use existing host string representation Hosts have a metatable __tostring method that produces a nice representation such as `VirtualHost "example.com"`, which even includes the component module for internal components.
author Kim Alvefur <zash@zash.se>
date Sat, 12 Jun 2021 16:47:30 +0200
parents 11603:4e24408a3f57
children 11605:225ef07f2bee
files plugins/mod_admin_shell.lua
diffstat 1 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_admin_shell.lua	Sat Jun 12 16:40:40 2021 +0200
+++ b/plugins/mod_admin_shell.lua	Sat Jun 12 16:47:30 2021 +0200
@@ -407,14 +407,8 @@
 		local mod = modulemanager.get_module(host, name);
 		if mod.module.host == "*" then
 			print("in global context");
-		elseif mod.module:get_host_type() == "local" then
-			print("on VirtualHost " .. mod.module.host);
-		elseif mod.module:get_host_type() == "component" then
-			local component_type = module:context(host):get_option_string("component_module", type);
-			if component_type == "component" then
-				component_type = "external";
-			end
-			print("on " .. component_type .. " Component " .. mod.module.host);
+		else
+			print("on " .. tostring(prosody.hosts[mod.module.host]));
 		end
 		print("  path: " .. (mod.module.path or "n/a"));
 		if mod.module.status_message then