Commit f5fab862 authored by Iustin Pop's avatar Iustin Pop
Browse files

Further cleanup after multi-evacuate removal

Commit f0edfcf6

 removed the parsing of multi-evacuate result, but the
code went from:

  if mode in (multi-evac, relocate):
    …
    if mode == relocate:
      …

to:

  if mode == relocate:
    …
    if mode == relocate
      …

This patch simply removes the nested if.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 2f41ea77
......@@ -13179,26 +13179,23 @@ class IAllocator(object):
errors.ECODE_INVAL)
if self.mode == constants.IALLOCATOR_MODE_RELOC:
assert self.relocate_from is not None
assert self.required_nodes == 1
node2group = dict((name, ndata["group"])
for (name, ndata) in self.in_data["nodes"].items())
fn = compat.partial(self._NodesToGroups, node2group,
self.in_data["nodegroups"])
if self.mode == constants.IALLOCATOR_MODE_RELOC:
assert self.relocate_from is not None
assert self.required_nodes == 1
request_groups = fn(self.relocate_from)
result_groups = fn(rdict["result"])
request_groups = fn(self.relocate_from)
result_groups = fn(rdict["result"])
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),
utils.CommaJoin(request_groups)))
else:
raise errors.ProgrammerError("Unhandled mode '%s'" % self.mode)
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),
utils.CommaJoin(request_groups)))
elif self.mode == constants.IALLOCATOR_MODE_NODE_EVAC:
assert self.evac_mode in constants.IALLOCATOR_NEVAC_MODES
......
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