Comparison

prosodyctl @ 8947:f12cc1d7aa65

prosodyctl: Warn if attempting to run an unknown check (fixes #1161)
author Kim Alvefur <zash@zash.se>
date Thu, 28 Jun 2018 10:56:24 +0200
parent 8881:a0de4fc4acd5
child 8948:3be8799263f3
child 9543:92bfb12684b0
comparison
equal deleted inserted replaced
8921:1c2925376315 8947:f12cc1d7aa65
987 local array, set = require "util.array", require "util.set"; 987 local array, set = require "util.array", require "util.set";
988 local it = require "util.iterators"; 988 local it = require "util.iterators";
989 local ok = true; 989 local ok = true;
990 local function disabled_hosts(host, conf) return host ~= "*" and conf.enabled ~= false; end 990 local function disabled_hosts(host, conf) return host ~= "*" and conf.enabled ~= false; end
991 local function enabled_hosts() return it.filter(disabled_hosts, pairs(config.getconfig())); end 991 local function enabled_hosts() return it.filter(disabled_hosts, pairs(config.getconfig())); end
992 if not (what == nil or what == "disabled" or what == "config" or what == "dns" or what == "certs") then
993 show_warning("Don't know how to check '%s'. Try one of 'config', 'dns', 'certs' or 'disabled'.", what);
994 return 1;
995 end
992 if not what or what == "disabled" then 996 if not what or what == "disabled" then
993 local disabled_hosts = set.new(); 997 local disabled_hosts = set.new();
994 for host, host_options in it.filter("*", pairs(config.getconfig())) do 998 for host, host_options in it.filter("*", pairs(config.getconfig())) do
995 if host_options.enabled == false then 999 if host_options.enabled == false then
996 disabled_hosts:add(host); 1000 disabled_hosts:add(host);