Diff

core/storagemanager.lua @ 6811:82350a06df6e

Merge 0.10->trunk
author Matthew Wild <mwild1@gmail.com>
date Wed, 02 Sep 2015 18:55:35 +0100
parent 6792:8b284787fe26
parent 6809:dd6b21862e3b
child 6952:db085e55555f
line wrap: on
line diff
--- a/core/storagemanager.lua	Mon Aug 24 13:16:49 2015 +1000
+++ b/core/storagemanager.lua	Wed Sep 02 18:55:35 2015 +0100
@@ -134,9 +134,14 @@
 	if type(storage) == "table" then
 		-- multiple storage backends in use that we need to purge
 		local purged = {};
-		for store, driver in pairs(storage) do
-			if not purged[driver] then
-				purged[driver] = get_driver(host, store):purge(user);
+		for store, driver_name in pairs(storage) do
+			if not purged[driver_name] then
+				local driver = get_driver(host, store);
+				if driver.purge then
+					purged[driver_name] = driver:purge(user);
+				else
+					log("warn", "Storage driver %s does not support removing all user data, you may need to delete it manually", driver_name);
+				end
 			end
 		end
 	end
@@ -172,6 +177,7 @@
 	load_driver = load_driver;
 	get_driver = get_driver;
 	open = open;
+	purge = purge;
 
 	olddm = olddm;
 };