+ numslots = 0
+ while numslots <= 0 or numslots > 4096
+ print "How many slots do you want to move (from 1 to 4096)?"
+ numslots = STDIN.gets.to_i
+ end
+ target = nil
+ while not target
+ print "What is the receiving node ID? "
+ target = get_node_by_name(STDIN.gets.chop)
+ if not target
+ puts "The specified node is not known, please retry."
+ end
+ end
+ sources = []
+ puts "Please enter all the source node IDs."
+ puts " Type 'all' to use all the nodes as source nodes for the hash slots."
+ puts " Type 'done' once you entered all the source nodes IDs."
+ while true
+ print "Source node ##{sources.length+1}:"
+ line = STDIN.gets.chop
+ src = get_node_by_name(line)
+ if line == "done"
+ if sources.length == 0
+ puts "No source nodes given, operation aborted"
+ exit 1
+ else
+ break
+ end
+ elsif line == "all"
+ @nodes.each{|n|
+ next if n.info[:name] == target.info[:name]
+ sources << n
+ }
+ break
+ elsif not src
+ puts "The specified node is not known, please retry."
+ elsif src.info[:name] == target.info[:name]
+ puts "It is not possible to use the target node as source node."
+ else
+ sources << src
+ end