]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - lib/rm/rm_dummy_runner.rb
Make pruning use the correct config and clean up *before* running tests, too.
[mailshears.git] / lib / rm / rm_dummy_runner.rb
index 9bdd13f5f47fb2dc1b71e7c012545c47c08e7e4a..62d9b628dd7db4b69c27a0804acae27e73325385 100644 (file)
@@ -3,18 +3,20 @@ require 'common/runner'
 class RmDummyRunner
   include Runner
 
-  def run(plugin, *targets)
+  def run(cfg, plugin, *targets)
     targets.each do |target|
-      if target.include?('@') then
-        puts "Would remove account: #{target}"
-        # TODO: remove from postfixadmin as well.
-      else
-        usernames = plugin.get_domain_usernames(target)
-        usernames.each { |u| run(plugin, u) }
+      target_description = plugin.describe(target)
+      msg =  "Would remove #{target.class.to_s().downcase()} #{target}"
 
-        puts "Would remove domain: #{target}"
-        # TODO: remove from postfixadmin as well.
+      # Only append the extra description if it's useful.
+      if not target_description.nil? and
+         not target_description.empty? and
+         not target_description == target.to_s() then
+        msg += " (#{target_description})"
       end
+      msg += '.'
+
+      report(plugin, msg)
     end
 
   end