aboutsummaryrefslogtreecommitdiffstats
path: root/core/storagemanager.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-07-28 21:30:24 +0200
committerKim Alvefur <zash@zash.se>2012-07-28 21:30:24 +0200
commit91aea551987526a15ab1b9146738c5b3e9ffe21b (patch)
tree2535fa28e3dd5456a8df1ce4a38c1462bbed949c /core/storagemanager.lua
parenta1c6c07c4426b65e5b40e0b5c903d78ae07e99d4 (diff)
downloadprosody-91aea551987526a15ab1b9146738c5b3e9ffe21b.tar.gz
prosody-91aea551987526a15ab1b9146738c5b3e9ffe21b.zip
storagemanager: Split out driver choosing from the open() method
Diffstat (limited to 'core/storagemanager.lua')
-rw-r--r--core/storagemanager.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/storagemanager.lua b/core/storagemanager.lua
index 71e79271..1a5f7d47 100644
--- a/core/storagemanager.lua
+++ b/core/storagemanager.lua
@@ -58,7 +58,7 @@ function load_driver(host, driver_name)
return stores_available:get(host, driver_name);
end
-function open(host, store, typ)
+function get_driver(host, store)
local storage = config.get(host, "core", "storage");
local driver_name;
local option_type = type(storage);
@@ -77,7 +77,11 @@ function open(host, store, typ)
driver_name = "null";
driver = null_storage_driver;
end
+ return driver, driver_name;
+ end
+function open(host, store, typ)
+ local driver, driver_name = get_driver(host, store);
local ret, err = driver:open(store, typ);
if not ret then
if err == "unsupported-store" then