Comparison

util/prosodyctl/check.lua @ 13706:a988867a5567 13.0

util.prosodyctl.check: Sort hosts in iterator for more stable output
author Matthew Wild <mwild1@gmail.com>
date Sat, 15 Feb 2025 16:31:10 +0000
parent 13705:5f1eb8b14923
child 13707:6c59b9072871
comparison
equal deleted inserted replaced
13705:5f1eb8b14923 13706:a988867a5567
323 local set = require "prosody.util.set"; 323 local set = require "prosody.util.set";
324 local it = require "prosody.util.iterators"; 324 local it = require "prosody.util.iterators";
325 local ok = true; 325 local ok = true;
326 local function contains_match(hayset, needle) for member in hayset do if member:find(needle) then return true end end end 326 local function contains_match(hayset, needle) for member in hayset do if member:find(needle) then return true end end end
327 local function disabled_hosts(host, conf) return host ~= "*" and conf.enabled ~= false; end 327 local function disabled_hosts(host, conf) return host ~= "*" and conf.enabled ~= false; end
328 local function enabled_hosts() return it.filter(disabled_hosts, pairs(configmanager.getconfig())); end 328 local function enabled_hosts() return it.filter(disabled_hosts, it.sorted_pairs(configmanager.getconfig())); end
329 local checks = {}; 329 local checks = {};
330 function checks.disabled() 330 function checks.disabled()
331 local disabled_hosts_set = set.new(); 331 local disabled_hosts_set = set.new();
332 for host in it.filter("*", pairs(configmanager.getconfig())) do 332 for host in it.filter("*", pairs(configmanager.getconfig())) do
333 if api(host):get_option_boolean("enabled") == false then 333 if api(host):get_option_boolean("enabled") == false then