Revision e623dbe3 lib/config.py
b/lib/config.py | ||
---|---|---|
378 | 378 |
result.append("Master node is not a master candidate") |
379 | 379 |
|
380 | 380 |
# master candidate checks |
381 |
mc_now, mc_max = self._UnlockedGetMasterCandidateStats() |
|
381 |
mc_now, mc_max, _ = self._UnlockedGetMasterCandidateStats()
|
|
382 | 382 |
if mc_now < mc_max: |
383 | 383 |
result.append("Not enough master candidates: actual %d, target %d" % |
384 | 384 |
(mc_now, mc_max)) |
... | ... | |
1015 | 1015 |
@type exceptions: list |
1016 | 1016 |
@param exceptions: if passed, list of nodes that should be ignored |
1017 | 1017 |
@rtype: tuple |
1018 |
@return: tuple of (current, desired and possible) |
|
1018 |
@return: tuple of (current, desired and possible, possible)
|
|
1019 | 1019 |
|
1020 | 1020 |
""" |
1021 |
mc_now = mc_max = 0 |
|
1021 |
mc_now = mc_should = mc_max = 0
|
|
1022 | 1022 |
for node in self._config_data.nodes.values(): |
1023 | 1023 |
if exceptions and node.name in exceptions: |
1024 | 1024 |
continue |
... | ... | |
1026 | 1026 |
mc_max += 1 |
1027 | 1027 |
if node.master_candidate: |
1028 | 1028 |
mc_now += 1 |
1029 |
mc_max = min(mc_max, self._config_data.cluster.candidate_pool_size)
|
|
1030 |
return (mc_now, mc_max) |
|
1029 |
mc_should = min(mc_max, self._config_data.cluster.candidate_pool_size)
|
|
1030 |
return (mc_now, mc_should, mc_max)
|
|
1031 | 1031 |
|
1032 | 1032 |
@locking.ssynchronized(_config_lock, shared=1) |
1033 | 1033 |
def GetMasterCandidateStats(self, exceptions=None): |
... | ... | |
1051 | 1051 |
@return: list with the adjusted nodes (L{objects.Node} instances) |
1052 | 1052 |
|
1053 | 1053 |
""" |
1054 |
mc_now, mc_max = self._UnlockedGetMasterCandidateStats() |
|
1054 |
mc_now, mc_max, _ = self._UnlockedGetMasterCandidateStats()
|
|
1055 | 1055 |
mod_list = [] |
1056 | 1056 |
if mc_now < mc_max: |
1057 | 1057 |
node_list = self._config_data.nodes.keys() |
Also available in: Unified diff