plugins/mod_admin_shell.lua
changeset 11936 92925f1320e7
parent 11935 c65d5da8e99a
child 11947 cf47834d3698
--- a/plugins/mod_admin_shell.lua	Wed Nov 24 20:03:38 2021 +0100
+++ b/plugins/mod_admin_shell.lua	Wed Nov 24 20:12:22 2021 +0100
@@ -426,6 +426,8 @@
 		return false, "mod_" .. name .. " does not appear to be loaded on the specified hosts";
 	end
 
+	local function item_name(item) return item.name; end
+
 	local friendly_descriptions = {
 		["adhoc-provider"] = "Ad-hoc commands",
 		["auth-provider"] = "Authentication provider",
@@ -438,11 +440,11 @@
 	local item_formatters = {
 		["feature"] = tostring,
 		["identity"] = function(ident) return ident.type .. "/" .. ident.category; end,
-		["adhoc-provider"] = function(item) return item.name; end,
-		["auth-provider"] = function(item) return item.name; end,
-		["storage-provider"] = function(item) return item.name; end,
+		["adhoc-provider"] = item_name,
+		["auth-provider"] = item_name,
+		["storage-provider"] = item_name,
 		["http-provider"] = function(item, mod) return mod:http_url(item.name); end,
-		["net-provider"] = function(item) return item.name; end,
+		["net-provider"] = item_name,
 		["measure"] = function(item) return item.name .. " (" .. suf(item.conf and item.conf.unit, " ") .. item.type .. ")"; end,
 		["metric"] = function(item)
 			return ("%s (%s%s)%s"):format(item.name, suf(item.mf.unit, " "), item.mf.type_, pre(": ", item.mf.description));