Comparison

prosodyctl @ 8787:5dbebb7627ef

prosodyctl: Config check for modules that are also components (fixes #1138)
author Kim Alvefur <zash@zash.se>
date Fri, 11 May 2018 16:03:35 +0200
parent 8718:c23cdeac5b61
child 8882:a420b386a72a
comparison
equal deleted inserted replaced
8786:adffadd88ff0 8787:5dbebb7627ef
836 print(" Consider moving these modules into modules_enabled in the global section:") 836 print(" Consider moving these modules into modules_enabled in the global section:")
837 print(" "..tostring(suggested_global_modules / function (x) return ("%q"):format(x) end)); 837 print(" "..tostring(suggested_global_modules / function (x) return ("%q"):format(x) end));
838 end 838 end
839 print(); 839 print();
840 end 840 end
841
842 do -- Check for modules enabled both normally and as components
843 local modules = set.new(config["*"]["modules_enabled"]);
844 for host, options in enabled_hosts() do
845 local component_module = options.component_module;
846 if component_module and modules:contains(component_module) then
847 print((" mod_%s is enabled both in modules_enabled and as Component %q %q"):format(component_module, host, component_module));
848 print(" This means the service is enabled on all VirtualHosts as well as the Component.");
849 print(" Are you sure this what you want? It may cause unexpected behaviour.");
850 end
851 end
852 end
853
841 -- Check for global options under hosts 854 -- Check for global options under hosts
842 local global_options = set.new(it.to_array(it.keys(config["*"]))); 855 local global_options = set.new(it.to_array(it.keys(config["*"])));
843 local deprecated_global_options = set.intersection(global_options, deprecated); 856 local deprecated_global_options = set.intersection(global_options, deprecated);
844 if not deprecated_global_options:empty() then 857 if not deprecated_global_options:empty() then
845 print(""); 858 print("");