LUNodeEvacuationStrategy: Use default iallocator
authorApollon Oikonomopoulos <apollon@noc.grnet.gr>
Thu, 8 Jul 2010 12:05:01 +0000 (15:05 +0300)
committerIustin Pop <iustin@google.com>
Thu, 8 Jul 2010 13:45:15 +0000 (15:45 +0200)
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/cmdlib.py
scripts/gnt-node

index ae07551..7cd5100 100644 (file)
@@ -8219,9 +8219,7 @@ class LUNodeEvacuationStrategy(NoHooksLU):
   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)
index 9e96248..acddc83 100755 (executable)
@@ -253,11 +253,6 @@ def EvacuateNode(opts, args):
   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)