X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Frm%2Frm_dummy_runner.rb;h=62d9b628dd7db4b69c27a0804acae27e73325385;hp=d6c2c5f85223a80ce93c6d9a2f4b126954c3b20a;hb=bdc364373ecbf7514f288bc7181cb2e94f1f8430;hpb=e3826d8926e11763837a591986d453e9ef5d9dec diff --git a/lib/rm/rm_dummy_runner.rb b/lib/rm/rm_dummy_runner.rb index d6c2c5f..62d9b62 100644 --- a/lib/rm/rm_dummy_runner.rb +++ b/lib/rm/rm_dummy_runner.rb @@ -1,16 +1,24 @@ +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}" - else - puts "Would remove domain: #{target}" + 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 - # TODO: remove from postfixadmin as well. end end