Make pruning use the correct config and clean up *before* running tests, too.
[mailshears.git] / lib / prune / prune_runner.rb
index 8ae8ad218bcbc402e167509dca190ab62cbec5fb..fbad8e8f11c4e5cb71f7dcc2ccbdc0caf7ad40b5 100644 (file)
@@ -5,11 +5,10 @@ require 'rm/rm_runner'
 class PruneRunner
   include Runner
 
-  def run(plugin)
+  def run(cfg, plugin)
     # We don't want to check the PostfixAdmin database against itself.
     return if plugin.class == PostfixadminPrune
 
-    cfg = Configuration.new()
     pfa = PostfixadminPrune.new(cfg)
 
     db_users = pfa.list_users()
@@ -19,7 +18,7 @@ class PruneRunner
     leftovers += plugin.get_leftover_domains(db_domains)
 
     rm_runner = RmRunner.new()
-    rm_runner.run(plugin, *leftovers)
+    rm_runner.run(cfg, plugin, *leftovers)
   end
 
 end