Fix LUReplaceDisks with iallocator
authorGuido Trotter <ultrotter@google.com>
Fri, 18 Jul 2008 10:30:39 +0000 (10:30 +0000)
committerGuido Trotter <ultrotter@google.com>
Fri, 18 Jul 2008 10:30:39 +0000 (10:30 +0000)
self._RunAllocator() sets self.op.remote_node, but doesn't return the
new remote node. If we set it to the return value of the function we
basically reset it to None, and iallocator is never run.

Reviewed-by: imsnah

lib/cmdlib.py

index 658b81d..b8ac93e 100644 (file)
@@ -4207,7 +4207,7 @@ class LUReplaceDisks(LogicalUnit):
       if self.op.remote_node is not None:
         raise errors.OpPrereqError("Give either the iallocator or the new"
                                    " secondary, not both")
-      self.op.remote_node = self._RunAllocator()
+      self._RunAllocator()
 
     remote_node = self.op.remote_node
     if remote_node is not None: