prosodyctl: check: Replace loaded-module calculation with a more accurate query to modulemanager, fixes #1171
authorMatthew Wild <mwild1@gmail.com>
Wed, 20 Jun 2018 10:42:57 +0100
changeset 8920 d4c98115e00c
parent 8919 e727747279a0
child 8921 f69b3e39e0c1
prosodyctl: check: Replace loaded-module calculation with a more accurate query to modulemanager, fixes #1171
prosodyctl
--- a/prosodyctl	Wed Jun 20 10:41:02 2018 +0100
+++ b/prosodyctl	Wed Jun 20 10:42:57 2018 +0100
@@ -1079,9 +1079,11 @@
 				target_hosts:remove("localhost");
 			end
 
-			local modules = set.new(it.to_array(it.values(host_options.modules_enabled or {})))
-			                + set.new(it.to_array(it.values(configmanager.get("*", "modules_enabled") or {})))
-			                + set.new({ configmanager.get(host, "component_module") });
+			local modules, component_module = modulemanager.get_modules_for_host(host);
+
+			if component_module then
+				modules:add(component_module);
+			end
 
 			if modules:contains("proxy65") then
 				local proxy65_target = configmanager.get(host, "proxy65_address") or host;