Diff

core/storagemanager.lua @ 6949:1c2c3d913172

storagemanager: Split config retrieval into its own function
author Matthew Wild <mwild1@gmail.com>
date Thu, 03 Dec 2015 14:47:47 +0000
parent 6809:dd6b21862e3b
child 6951:99de8f30d99e
line wrap: on
line diff
--- 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 = {};