Revision c1410048
b/lib/cmdlib/cluster.py | ||
---|---|---|
1329 | 1329 |
if self.op.candidate_pool_size is not None: |
1330 | 1330 |
self.cluster.candidate_pool_size = self.op.candidate_pool_size |
1331 | 1331 |
# we need to update the pool size here, otherwise the save will fail |
1332 |
AdjustCandidatePool(self, []) |
|
1332 |
AdjustCandidatePool(self, [], feedback_fn)
|
|
1333 | 1333 |
|
1334 | 1334 |
if self.op.maintain_node_health is not None: |
1335 | 1335 |
if self.op.maintain_node_health and not constants.ENABLE_CONFD: |
b/lib/cmdlib/common.py | ||
---|---|---|
426 | 426 |
lu.cfg.GetNodeName(node_uuid)) |
427 | 427 |
|
428 | 428 |
|
429 |
def AdjustCandidatePool(lu, exceptions): |
|
429 |
def AdjustCandidatePool(lu, exceptions, feedback_fn):
|
|
430 | 430 |
"""Adjust the candidate pool after node operations. |
431 | 431 |
|
432 | 432 |
""" |
... | ... | |
436 | 436 |
utils.CommaJoin(node.name for node in mod_list)) |
437 | 437 |
for node in mod_list: |
438 | 438 |
lu.context.ReaddNode(node) |
439 |
cluster = lu.cfg.GetClusterInfo() |
|
440 |
AddNodeCertToCandidateCerts(lu, node.uuid, cluster) |
|
441 |
lu.cfg.Update(cluster, feedback_fn) |
|
439 | 442 |
mc_now, mc_max, _ = lu.cfg.GetMasterCandidateStats(exceptions) |
440 | 443 |
if mc_now > mc_max: |
441 | 444 |
lu.LogInfo("Note: more nodes are candidates (%d) than desired (%d)" % |
b/lib/cmdlib/node.py | ||
---|---|---|
782 | 782 |
|
783 | 783 |
# we locked all nodes, we adjust the CP before updating this node |
784 | 784 |
if self.lock_all: |
785 |
AdjustCandidatePool(self, [node.uuid]) |
|
785 |
AdjustCandidatePool(self, [node.uuid], feedback_fn)
|
|
786 | 786 |
|
787 | 787 |
cluster = self.cfg.GetClusterInfo() |
788 | 788 |
# if node gets promoted, grant RPC priviledges |
... | ... | |
1481 | 1481 |
"Not owning BGL" |
1482 | 1482 |
|
1483 | 1483 |
# Promote nodes to master candidate as needed |
1484 |
AdjustCandidatePool(self, exceptions=[self.node.uuid])
|
|
1484 |
AdjustCandidatePool(self, [self.node.uuid], feedback_fn)
|
|
1485 | 1485 |
self.context.RemoveNode(self.node) |
1486 | 1486 |
|
1487 | 1487 |
# Run post hooks on the node before it's removed |
Also available in: Unified diff