Comparison

core/storagemanager.lua @ 5131:0cd962661fa2

storagemanager: Remove usage of 'core' when calling configmanager.get()
author Matthew Wild <mwild1@gmail.com>
date Wed, 19 Sep 2012 12:08:33 +0100
parent 5130:051d352ed03c
child 5133:1443d1c37c6c
comparison
equal deleted inserted replaced
5130:051d352ed03c 5131:0cd962661fa2
57 end 57 end
58 return stores_available:get(host, driver_name); 58 return stores_available:get(host, driver_name);
59 end 59 end
60 60
61 function get_driver(host, store) 61 function get_driver(host, store)
62 local storage = config.get(host, "core", "storage"); 62 local storage = config.get(host, "storage");
63 local driver_name; 63 local driver_name;
64 local option_type = type(storage); 64 local option_type = type(storage);
65 if option_type == "string" then 65 if option_type == "string" then
66 driver_name = storage; 66 driver_name = storage;
67 elseif option_type == "table" then 67 elseif option_type == "table" then
68 driver_name = storage[store]; 68 driver_name = storage[store];
69 end 69 end
70 if not driver_name then 70 if not driver_name then
71 driver_name = config.get(host, "core", "default_storage") or "internal"; 71 driver_name = config.get(host, "default_storage") or "internal";
72 end 72 end
73 73
74 local driver = load_driver(host, driver_name); 74 local driver = load_driver(host, driver_name);
75 if not driver then 75 if not driver then
76 log("warn", "Falling back to null driver for %s storage on %s", store, host); 76 log("warn", "Falling back to null driver for %s storage on %s", store, host);
93 end 93 end
94 return ret, err; 94 return ret, err;
95 end 95 end
96 96
97 function purge(user, host) 97 function purge(user, host)
98 local storage = config.get(host, "core", "storage"); 98 local storage = config.get(host, "storage");
99 local driver_name; 99 local driver_name;
100 if type(storage) == "table" then 100 if type(storage) == "table" then
101 -- multiple storage backends in use that we need to purge 101 -- multiple storage backends in use that we need to purge
102 local purged = {}; 102 local purged = {};
103 for store, driver in pairs(storage) do 103 for store, driver in pairs(storage) do