Comparison

core/modulemanager.lua @ 5123:7c5c86fa552e

hostmanager, modulemanager: Ensure hosts[*].modules always exists.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 13 Sep 2012 00:32:12 +0500
parent 5021:85b2689dbcfe
child 5192:3fc3a3072cc2
comparison
equal deleted inserted replaced
5122:b41c33dc7c36 5123:7c5c86fa552e
117 elseif not hosts[host] and host ~= "*"then 117 elseif not hosts[host] and host ~= "*"then
118 return nil, "unknown-host"; 118 return nil, "unknown-host";
119 end 119 end
120 120
121 if not modulemap[host] then 121 if not modulemap[host] then
122 modulemap[host] = {}; 122 modulemap[host] = hosts[host].modules;
123 if host ~= "*" then
124 hosts[host].modules = modulemap[host];
125 end
126 end 123 end
127 124
128 if modulemap[host][module_name] then 125 if modulemap[host][module_name] then
129 log("warn", "%s is already loaded for %s, so not loading again", module_name, host); 126 log("warn", "%s is already loaded for %s, so not loading again", module_name, host);
130 return nil, "module-already-loaded"; 127 return nil, "module-already-loaded";