52db27be6f0082051ee17565c7ee7b8b5c61b31a
[mailshears.git] / lib / mv / mv_dummy_runner.rb
1 require 'common/runner'
2
3 class MvDummyRunner
4 include Runner
5
6 def run(plugin, src, dst)
7
8 if src.is_a?(Domain) or dst.is_a?(Domain) then
9 msg = 'only users can be moved'
10 raise NotImplementedError.new(msg)
11 end
12
13 # Since we're not actually moving anything, the destination
14 # description is really only useful for seeing whether or not we'd
15 # be trying to move in on top of an existing account.
16 src_description = plugin.describe(src)
17 dst_description = plugin.describe(dst)
18
19 msg = "Would move user #{src} "
20
21 # Only append the extra description if it's useful.
22 if not src_description.nil? and
23 not src_description.empty? and
24 not src_description == src.to_s() then
25 msg += "(#{src_description}) "
26 end
27
28 msg += "to #{dst}"
29
30 # Only append the extra description if it's useful.
31 if not dst_description.nil? and
32 not dst_description.empty? and
33 not dst_description == dst.to_s() then
34 msg += " (#{dst_description})"
35 end
36
37 msg += "."
38 report(plugin, msg)
39 end
40
41 end