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

Fix _AdjustCandidatePool

Currently the ConfigWriter.MaintainCandidatePool returns node names, and
_AdjustCandidatePool uses them as such, but then it passes these to
context.ReaddNode which in turn passes them to jqueue.JobQueue.AddNode which
uses them as objects.Node instances.

Since this is currently the only usage, we change return type from
ConfigWriter.MaintainCandidatePool to be objects and adjust the logging of
their names, so that the auto-adjusement works.

Reviewed-by: ultrotter
parent 3a5ba66a
......@@ -533,7 +533,7 @@ def _AdjustCandidatePool(lu):
mod_list = lu.cfg.MaintainCandidatePool()
if mod_list:
lu.LogInfo("Promoted nodes to master candidate role: %s",
", ".join(mod_list))
", ".join( for node in mod_list))
for name in mod_list:
mc_now, mc_max = lu.cfg.GetMasterCandidateStats()
......@@ -809,7 +809,7 @@ class ConfigWriter:
"""Try to grow the candidate pool to the desired size.
@rtype: list
@return: list with the adjusted node names
@return: list with the adjusted nodes (L{objects.Node} instances)
mc_now, mc_max = self._UnlockedGetMasterCandidateStats()
......@@ -823,7 +823,7 @@ class ConfigWriter:
node = self._config_data.nodes[name]
if node.master_candidate or node.offline:
node.master_candidate = True
node.serial_no += 1
mc_now += 1
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