modulemanager: Allow loading a module onto "*" (part-fixes #228)
authorMatthew Wild <mwild1@gmail.com>
Sat, 21 Apr 2012 20:00:30 +0100
changeset 4638 352cd61e2682
parent 4637 1f6c6c678f96
child 4639 98a29138dec8
modulemanager: Allow loading a module onto "*" (part-fixes #228)
core/modulemanager.lua
--- a/core/modulemanager.lua	Sat Apr 21 16:27:42 2012 +0100
+++ b/core/modulemanager.lua	Sat Apr 21 20:00:30 2012 +0100
@@ -117,13 +117,15 @@
 local function do_load_module(host, module_name)
 	if not (host and module_name) then
 		return nil, "insufficient-parameters";
-	elseif not hosts[host] then
+	elseif not hosts[host] and host ~= "*"then
 		return nil, "unknown-host";
 	end
 	
 	if not modulemap[host] then
 		modulemap[host] = {};
-		hosts[host].modules = modulemap[host];
+		if host ~= "*" then
+			hosts[host].modules = modulemap[host];
+		end
 	end
 	
 	if modulemap[host][module_name] then