# HG changeset patch # User Matthew Wild # Date 1449154067 0 # Node ID 1c2c3d913172efbec8fd392aa74fab41b93b48c9 # Parent e6968e47826d9932954e773438f1df376530765d storagemanager: Split config retrieval into its own function diff -r e6968e47826d -r 1c2c3d913172 core/storagemanager.lua --- a/core/storagemanager.lua Thu Dec 03 15:27:09 2015 +0100 +++ b/core/storagemanager.lua Thu Dec 03 14:47:47 2015 +0000 @@ -57,8 +57,12 @@ 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 @@ 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 = {};