plugin_class = nil
-runner_class = nil
-dummy_runner_class = nil
if mode == :rm then
plugin_class = RmPlugin
- runner_class = RmRunner
- dummy_runner_class = RmDummyRunner
elsif mode == :mv then
plugin_class = MvPlugin
- runner_class = MvRunner
- dummy_runner_class = MvDummyRunner
else
# Safe, catch-all default
plugin_class = PrunePlugin
- runner_class = PruneRunner
- dummy_runner_class = PruneDummyRunner
end
plugin = plugin_class_includer.new(cfg)
if cfg.i_mean_business then
- runner = runner_class.new()
+ runner = plugin.runner().new()
else
- runner = dummy_runner_class.new()
+ runner = plugin.dummy_runner().new()
end
# The splat passes the correct (we hope) number of arguments to the
return @includers
end
+ def runner()
+ # The Runner associated with this plugin.
+ raise NotImplementedError
+ end
+
+ def dummy_runner()
+ # The RummyRunner associated with this plugin.
+ raise NotImplementedError
+ end
+
def describe_domain(domain)
# Provide a "description" of the domain. This is output along
# with the domain name and can be anything of use to the system
return @includers
end
+ def runner()
+ return MvRunner
+ end
+
+ def dummy_runner()
+ return MvDummyRunner
+ end
+
def mv_domain(from, to)
# Rename the given domain.
raise NotImplementedError
return @includers
end
+ def runner()
+ return PruneRunner
+ end
+
+ def dummy_runner
+ return PruneDummyRunner
+ end
+
def get_leftover_domains(db_domains)
# Given a list of domains, determine which domains belonging to
# this plugin are not contained in the given list.
targets.each do |target|
if target.include?('@') then
user_description = plugin.describe_user(target)
- report(plugin, "Would remove user: #{user} (#{user_description})")
+ report(plugin, "Would remove user: #{target} (#{user_description})")
else
domain_description = plugin.describe_domain(target)
- report(plugin, "Would remove domain: #{domain} (#{domain_description})")
+ report(plugin, "Would remove domain: #{target} (#{domain_description})")
end
end
return @includers
end
+ def runner()
+ return RmRunner
+ end
+
+ def dummy_runner()
+ return RmDummyRunner
+ end
+
def delete_domain(domain)
# Delete the given domain. Some plugins don't have a concept of
# domains, so just delete all users with a username that looks