core/modulemanager.lua

changeset 3598
48ebea937260
parent 3596
bbeba9f2acf8
child 3608
ae0f83feaff4
--- a/core/modulemanager.lua	Wed Nov 10 19:57:35 2010 +0500
+++ b/core/modulemanager.lua	Wed Nov 10 20:14:33 2010 +0500
@@ -91,6 +91,8 @@
 function load(host, module_name, config)
 	if not (host and module_name) then
 		return nil, "insufficient-parameters";
+	elseif not hosts[host] then
+		return nil, "unknown-host";
 	end
 	
 	if not modulemap[host] then
@@ -118,11 +120,6 @@
 	api_instance.environment = pluginenv;
 	
 	setfenv(mod, pluginenv);
-	if not hosts[host] then
-		local create_component = _G.require "core.componentmanager".create_component;
-		hosts[host] = create_component(host);
-		log("debug", "Created new component: %s", host);
-	end
 	hosts[host].modules = modulemap[host];
 	modulemap[host][module_name] = pluginenv;
 	

mercurial