X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Frm%2Frm_dummy_runner.rb;h=2ab25e80a3e402f5ba3c21214b30a768d6c2cd2c;hp=091d32881bb9940f5f72c5ff2f67c3ba0030010e;hb=650e23790019880da91c7c7248a214a13763fd3e;hpb=4e7ef12d3d47aa7ec68419de46c51269c40eb158 diff --git a/lib/rm/rm_dummy_runner.rb b/lib/rm/rm_dummy_runner.rb index 091d328..2ab25e8 100644 --- a/lib/rm/rm_dummy_runner.rb +++ b/lib/rm/rm_dummy_runner.rb @@ -5,13 +5,18 @@ class RmDummyRunner def run(plugin, *targets) targets.each do |target| - if target.include?('@') then - user_description = plugin.describe_account(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