Commit 2f41ea77 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix bug in IAllocator parsing of Evacuate result

Commit 342f9172

 added stricter checks for the iallocator result in
evacuate mode, but it does this irrespective of the result
status. When the result has failed and (according to the design) the
list of nodes is empty, this code will trigger the following:

    node1# gnt-instance replace-disks -I hail instance14
    Failure: command execution error:
    Groups of nodes returned by iallocator () differ from original groups (default)

After the patch, the result is:

    node1# gnt-instance replace-disks -I hail instance14
    Failure: prerequisites not met for this operation:
    error type: insufficient_resources, error details:
    Can't compute nodes using iallocator 'hail': Request failed: …
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 16629d10
......@@ -13192,7 +13192,7 @@ class IAllocator(object):
request_groups = fn(self.relocate_from)
result_groups = fn(rdict["result"])
if result_groups != request_groups:
if self.success and result_groups != request_groups:
raise errors.OpExecError("Groups of nodes returned by iallocator (%s)"
" differ from original groups (%s)" %
(utils.CommaJoin(result_groups),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment