aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-04-21 20:39:21 +0100
committerMatthew Wild <mwild1@gmail.com>2012-04-21 20:39:21 +0100
commit15b81453cd9c57a787c2db9fd28fbf04a0a98334 (patch)
treeb3e8eaf833f164141f71ff648c80057831ceea01 /plugins
parente774a4c4ba1f57888f40b5dc5cf93b19ad2b81d2 (diff)
downloadprosody-15b81453cd9c57a787c2db9fd28fbf04a0a98334.tar.gz
prosody-15b81453cd9c57a787c2db9fd28fbf04a0a98334.zip
mod_admin_telnet: module:reload(): If module is loaded on *, reload it there first (ensuring shared module code is reloaded before per-host children of that module)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_admin_telnet.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index e60a2245..2f2e057b 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -334,11 +334,15 @@ end
function def_env.module:reload(name, hosts)
local mm = require "modulemanager";
- hosts = get_hosts_set(hosts, name);
-
+ hosts = array.collect(get_hosts_set(hosts, name)):sort(function (a, b)
+ if a == "*" then return true
+ elseif b == "*" then return false
+ else return a < b; end
+ end);
+
-- Reload the module for each host
local ok, err, count = true, nil, 0;
- for host in hosts do
+ for _, host in ipairs(hosts) do
if mm.is_loaded(host, name) then
ok, err = mm.reload(host, name);
if not ok then