From fb55a7df98190568bc93ef889967148ecc2b5ec4 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 3 Dec 2015 14:47:47 +0000 Subject: storagemanager: Split config retrieval into its own function --- core/storagemanager.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/storagemanager.lua b/core/storagemanager.lua index fb868d03..21f5fd1d 100644 --- a/core/storagemanager.lua +++ b/core/storagemanager.lua @@ -57,8 +57,12 @@ local function load_driver(host, driver_name) return stores_available:get(host, driver_name); end +local function get_storage_config(host) + return config.get(host, "storage"); +end + local function get_driver(host, store) - local storage = config.get(host, "storage"); + local storage = get_storage_config(host); local driver_name; local option_type = type(storage); if option_type == "string" then @@ -94,7 +98,7 @@ local function open(host, store, typ) end local function purge(user, host) - local storage = config.get(host, "storage"); + local storage = get_storage_config(host); if type(storage) == "table" then -- multiple storage backends in use that we need to purge local purged = {}; -- cgit v1.2.3