Revision 44485f49 lib/config.py
b/lib/config.py | ||
---|---|---|
1044 | 1044 |
return self._UnlockedGetMasterCandidateStats(exceptions) |
1045 | 1045 |
|
1046 | 1046 |
@locking.ssynchronized(_config_lock) |
1047 |
def MaintainCandidatePool(self): |
|
1047 |
def MaintainCandidatePool(self, exceptions):
|
|
1048 | 1048 |
"""Try to grow the candidate pool to the desired size. |
1049 | 1049 |
|
1050 |
@type exceptions: list |
|
1051 |
@param exceptions: if passed, list of nodes that should be ignored |
|
1050 | 1052 |
@rtype: list |
1051 | 1053 |
@return: list with the adjusted nodes (L{objects.Node} instances) |
1052 | 1054 |
|
1053 | 1055 |
""" |
1054 |
mc_now, mc_max, _ = self._UnlockedGetMasterCandidateStats() |
|
1056 |
mc_now, mc_max, _ = self._UnlockedGetMasterCandidateStats(exceptions)
|
|
1055 | 1057 |
mod_list = [] |
1056 | 1058 |
if mc_now < mc_max: |
1057 | 1059 |
node_list = self._config_data.nodes.keys() |
... | ... | |
1060 | 1062 |
if mc_now >= mc_max: |
1061 | 1063 |
break |
1062 | 1064 |
node = self._config_data.nodes[name] |
1063 |
if node.master_candidate or node.offline or node.drained: |
|
1065 |
if (node.master_candidate or node.offline or node.drained or |
|
1066 |
node.name in exceptions): |
|
1064 | 1067 |
continue |
1065 | 1068 |
mod_list.append(node) |
1066 | 1069 |
node.master_candidate = True |
Also available in: Unified diff