This adds the flag and some initial handling. The rest of the changes,
for cmdlib, come in a separate patch.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
primary_ip=primary_ip,
secondary_ip=secondary_ip,
master_candidate=self.master_candidate,
+ master_capable=True,
+ vm_capable=True,
offline=False, drained=False,
group=node_group)
for node in self._config_data.nodes.values():
if exceptions and node.name in exceptions:
continue
- if not (node.offline or node.drained):
+ if not (node.offline or node.drained) and node.master_capable:
mc_max += 1
if node.master_candidate:
mc_now += 1
break
node = self._config_data.nodes[name]
if (node.master_candidate or node.offline or node.drained or
- node.name in exceptions):
+ node.name in exceptions or not node.master_capable):
continue
mod_list.append(node)
node.master_candidate = True
"offline",
"drained",
"group",
+ "master_capable",
+ "vm_capable",
] + _TIMESTAMPS + _UUID
+ def UpgradeConfig(self):
+ """Fill defaults for missing configuration values.
+
+ """
+ # pylint: disable-msg=E0203
+ # because these are "defined" via slots, not manually
+ if self.master_capable is None:
+ self.master_capable = True
+
+ if self.vm_capable is None:
+ self.vm_capable = True
+
class NodeGroup(ConfigObject):
"""Config object representing a node group."""