X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Frm%2Frm_dummy_runner.rb;h=62d9b628dd7db4b69c27a0804acae27e73325385;hp=60cf23ab8b32c12eefd06fce87a659c697689f0d;hb=a731b98f97194b8882c42d3c2b27de75f60d6b05;hpb=72696d3f6e95ef773af9727e9c3459b9038b0fc2 diff --git a/lib/rm/rm_dummy_runner.rb b/lib/rm/rm_dummy_runner.rb index 60cf23a..62d9b62 100644 --- a/lib/rm/rm_dummy_runner.rb +++ b/lib/rm/rm_dummy_runner.rb @@ -3,15 +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 - user_description = plugin.describe_user(target) - report(plugin, "Would remove user: #{user} (#{user_description})") - else - domain_description = plugin.describe_domain(target) - report(plugin, "Would remove domain: #{domain} (#{domain_description})") + target_description = plugin.describe(target) + msg = "Would remove #{target.class.to_s().downcase()} #{target}" + + # 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