# HG changeset patch # User Kim Alvefur # Date 1343503824 -7200 # Node ID be33164aa97e864a7b9c43a323c742d4b1b0fa43 # Parent 874cab7b4b3edcb8fd6f3daa17f0291dcbde18a9 storagemanager: Split out driver choosing from the open() method diff -r 874cab7b4b3e -r be33164aa97e core/storagemanager.lua --- a/core/storagemanager.lua Sat Jul 28 21:27:45 2012 +0200 +++ b/core/storagemanager.lua Sat Jul 28 21:30:24 2012 +0200 @@ -58,7 +58,7 @@ 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 @@ 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