aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-02-12 12:43:50 +0000
committerMatthew Wild <mwild1@gmail.com>2010-02-12 12:43:50 +0000
commit6014843e31c1af646ca3607f3b7594255d4e37ce (patch)
treeca954031386288af1393b9103c6f5f6007622f49
parent4f0a93132b72e171eb47680c8d6b337b4e591d97 (diff)
downloadprosody-6014843e31c1af646ca3607f3b7594255d4e37ce.tar.gz
prosody-6014843e31c1af646ca3607f3b7594255d4e37ce.zip
hostmanager: Log an error if no hosts are defined
-rw-r--r--core/hostmanager.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/hostmanager.lua b/core/hostmanager.lua
index 038085c3..722526f7 100644
--- a/core/hostmanager.lua
+++ b/core/hostmanager.lua
@@ -32,12 +32,19 @@ local hosts_loaded_once;
local function load_enabled_hosts(config)
local defined_hosts = config or configmanager.getconfig();
+ local activated_any_host;
for host, host_config in pairs(defined_hosts) do
if host ~= "*" and (host_config.core.enabled == nil or host_config.core.enabled) and not host_config.core.component_module then
+ activated_any_host = true;
activate(host, host_config);
end
end
+
+ if not activated_any_host then
+ log("error", "No hosts defined in the config file. This may cause unexpected behaviour as no modules will be loaded.");
+ end
+
eventmanager.fire_event("hosts-activated", defined_hosts);
hosts_loaded_once = true;
end