X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Fmv%2Fmv_runner.rb;h=6a4413b412ee8256b0988518f8659c59c0fec245;hp=fe44e5c244d3fe4cff66f140bb4d684ca903364a;hb=refs%2Ftags%2F0.0.4;hpb=df4e02ebf6a4e28a58abcb298a4442a245ad0b15 diff --git a/lib/mv/mv_runner.rb b/lib/mv/mv_runner.rb index fe44e5c..6a4413b 100644 --- a/lib/mv/mv_runner.rb +++ b/lib/mv/mv_runner.rb @@ -31,38 +31,24 @@ class MvRunner plugin.mv_user(src, dst) dst_description = plugin.describe(dst) - msg = "Moved user #{src} " - - # Only append the extra description if it's useful. - if not src_description.nil? and - not src_description.empty? and - not src_description == src.to_s() then - msg += "(#{src_description}) " - end - - msg += "to #{dst}" - - # Only append the extra description if it's useful. - if not dst_description.nil? and - not dst_description.empty? and - not dst_description == dst.to_s() then - msg += " (#{dst_description})" - end - + msg = "Moved user " + msg += add_description(src, src_description) + msg += " to " + msg += add_description(dst, dst_description) msg += "." report(plugin, msg) - rescue NonexistentUserError => e + rescue NonexistentUserError # This means that the SOURCE user didn't exist, since a # nonexistent destination user is perfectly expected. report(plugin, "Source user #{src.to_s()} not found.") - rescue NonexistentDomainError => e + rescue NonexistentDomainError # This could mean that the source domain doesn't exist, but in # that case, we just report that the source user doesn't # exist. So a nonexistent domain refers to a nonexistent # DESTINATION domain. report(plugin, "Destination domain #{dst.domainpart()} not found.") - rescue UserAlreadyExistsError => e + rescue UserAlreadyExistsError report(plugin, "Destination user #{dst.to_s()} already exists.") end end