From 64a6916f6e78f0fe345eb8381b621b22e53587ab Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 28 Jul 2012 21:30:24 +0200 Subject: storagemanager: Split out driver choosing from the open() method --- core/storagemanager.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3