# HG changeset patch # User Waqas Hussain # Date 1289402073 -18000 # Node ID 48ebea93726013365fb97ce6ae9229ba5bbe8912 # Parent 8090880f0e180f5d9bb9c2ef86c17e17c08b1bb9 modulemanager: Return an error when loading a module on a non-existent host, don't create the host. Removes dependecy on componentmanager. diff -r 8090880f0e18 -r 48ebea937260 core/modulemanager.lua --- 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;