+
+ protected;
+
+ # Remove *target* using *plugin*. This operation is separate from
+ # the <tt>run()</tt> method so that it can be accessed by the prune
+ # runner.
+ #
+ # @param plugin [RmPlugin] the plugin that will remove the *target*.
+ #
+ # @param target [User,Domain] the user or domain to remove.
+ #
+ def remove_target(plugin, target)
+ target_description = plugin.describe(target)
+
+ begin
+ plugin.remove(target)
+ msg = "Removed #{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)
+ rescue NonexistentDomainError, NonexistentUserError => e
+ report(plugin, "#{target.class.to_s()} #{e.to_s} not found.")
+ end
+ end