Revision 490acd18
b/lib/cmdlib.py | ||
---|---|---|
3703 | 3703 |
primary_ip=primary_ip, |
3704 | 3704 |
secondary_ip=secondary_ip, |
3705 | 3705 |
master_candidate=self.master_candidate, |
3706 |
master_capable=True, |
|
3707 |
vm_capable=True, |
|
3706 | 3708 |
offline=False, drained=False, |
3707 | 3709 |
group=node_group) |
3708 | 3710 |
|
b/lib/config.py | ||
---|---|---|
1198 | 1198 |
for node in self._config_data.nodes.values(): |
1199 | 1199 |
if exceptions and node.name in exceptions: |
1200 | 1200 |
continue |
1201 |
if not (node.offline or node.drained): |
|
1201 |
if not (node.offline or node.drained) and node.master_capable:
|
|
1202 | 1202 |
mc_max += 1 |
1203 | 1203 |
if node.master_candidate: |
1204 | 1204 |
mc_now += 1 |
... | ... | |
1239 | 1239 |
break |
1240 | 1240 |
node = self._config_data.nodes[name] |
1241 | 1241 |
if (node.master_candidate or node.offline or node.drained or |
1242 |
node.name in exceptions): |
|
1242 |
node.name in exceptions or not node.master_capable):
|
|
1243 | 1243 |
continue |
1244 | 1244 |
mod_list.append(node) |
1245 | 1245 |
node.master_candidate = True |
b/lib/objects.py | ||
---|---|---|
940 | 940 |
"offline", |
941 | 941 |
"drained", |
942 | 942 |
"group", |
943 |
"master_capable", |
|
944 |
"vm_capable", |
|
943 | 945 |
] + _TIMESTAMPS + _UUID |
944 | 946 |
|
947 |
def UpgradeConfig(self): |
|
948 |
"""Fill defaults for missing configuration values. |
|
949 |
|
|
950 |
""" |
|
951 |
# pylint: disable-msg=E0203 |
|
952 |
# because these are "defined" via slots, not manually |
|
953 |
if self.master_capable is None: |
|
954 |
self.master_capable = True |
|
955 |
|
|
956 |
if self.vm_capable is None: |
|
957 |
self.vm_capable = True |
|
958 |
|
|
945 | 959 |
|
946 | 960 |
class NodeGroup(ConfigObject): |
947 | 961 |
"""Config object representing a node group.""" |
Also available in: Unified diff