X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Frm%2Frm_runner.rb;h=71421547e7e88e02247070680dce940f890c30f2;hp=114aabc355ad1c215f0b95e3cf1f20a2a626ea4d;hb=c5a1271a37bed990f2fd8caa8fcde23a6e107b46;hpb=483d14dc8228a81d12fb109d3ed6510e2d2b03c1 diff --git a/lib/rm/rm_runner.rb b/lib/rm/rm_runner.rb index 114aabc..7142154 100644 --- a/lib/rm/rm_runner.rb +++ b/lib/rm/rm_runner.rb @@ -1,3 +1,4 @@ +require 'common/errors' require 'common/runner' class RmRunner @@ -5,17 +6,17 @@ class RmRunner def run(plugin, *targets) targets.each do |target| - # Why think too hard? An account has an @, a domain doesn't. + # Why think too hard? An user has an @, a domain doesn't. if target.include?('@') then begin - account_description = plugin.describe_account(target) - plugin.delete_account(target) - report(plugin, "Removed account: #{target} (#{account_description})") + user_description = plugin.describe_user(target) + plugin.delete_user(target) + report(plugin, "Removed user: #{target} (#{user_description})") - rescue NonexistentAccountError => e - report(plugin, "Account not found: #{e.to_s}") + rescue NonexistentUserError => e + report(plugin, "User not found: #{e.to_s}") rescue StandardError => e - report(plugin, "There was an error removing the account: #{e.to_s}") + report(plugin, "There was an error removing the user: #{e.to_s}") Kernel.exit(ExitCodes::DATABASE_ERROR) end else @@ -24,9 +25,9 @@ class RmRunner plugin.delete_domain(target) report(plugin, "Removed domain: #{target} (#{domain_description})") - rescue NonexistentAccountError => e + rescue NonexistentUserError => e # Can happen in the usernames.each... block. - report(plugin, "Account not found: #{e.to_s}") + report(plugin, "User not found: #{e.to_s}") rescue NonexistentDomainError => e report(plugin, "Domain not found: #{e.to_s}") rescue StandardError => e