Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
REQ_BGL = False
def CheckArguments(self):
- if self.op.remote_node is not None and self.op.iallocator is not None:
- raise errors.OpPrereqError("Give either the iallocator or the new"
- " secondary, not both", errors.ECODE_INVAL)
+ _CheckIAllocatorOrNode(self, "iallocator", "remote_node")
def ExpandNames(self):
self.op.nodes = _GetWantedNodes(self, self.op.nodes)
dst_node = opts.dst_node
iallocator = opts.iallocator
- cnt = [dst_node, iallocator].count(None)
- if cnt != 1:
- raise errors.OpPrereqError("One and only one of the -n and -I"
- " options must be passed", errors.ECODE_INVAL)
-
op = opcodes.OpNodeEvacuationStrategy(nodes=args,
iallocator=iallocator,
remote_node=dst_node)