# HG changeset patch # User Kim Alvefur # Date 1557065060 -7200 # Node ID 611ac62c5b633851aa85ba063316d66d810a878b # Parent a36412d4fafd8229e41f07f5b56906ee78e4621e mod_migrate: Try to use per storage user listing where available diff -r a36412d4fafd -r 611ac62c5b63 mod_migrate/mod_migrate.lua --- a/mod_migrate/mod_migrate.lua Sun May 05 14:47:07 2019 +0200 +++ b/mod_migrate/mod_migrate.lua Sun May 05 16:04:20 2019 +0200 @@ -1,8 +1,17 @@ -- mod_migrate +local unpack = table.unpack or unpack; local sm = require"core.storagemanager"; local um = require"core.usermanager"; +local function users(store, host) + if store.users then + return store:users(); + else + return um.users(host); + end +end + function module.command(arg) local host, source_stores, migrate_to = unpack(arg); if not migrate_to then @@ -62,7 +71,7 @@ end else xpcall(function() - for user in um.users(host) do + for user in users(storage, host) do migrate_user(user); end end,