+ "modify_etc_hosts",
+ "modify_ssh_setup",
+ "maintain_node_health",
+ "uid_pool",
+ ] + _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.hvparams is None:
+ self.hvparams = constants.HVC_DEFAULTS
+ else:
+ for hypervisor in self.hvparams:
+ self.hvparams[hypervisor] = FillDict(
+ constants.HVC_DEFAULTS[hypervisor], self.hvparams[hypervisor])
+
+ # TODO: Figure out if it's better to put this into OS than Cluster
+ if self.os_hvp is None:
+ self.os_hvp = {}
+
+ self.beparams = UpgradeGroupedParams(self.beparams,
+ constants.BEC_DEFAULTS)
+ migrate_default_bridge = not self.nicparams
+ self.nicparams = UpgradeGroupedParams(self.nicparams,
+ constants.NICC_DEFAULTS)
+ if migrate_default_bridge:
+ self.nicparams[constants.PP_DEFAULT][constants.NIC_LINK] = \
+ self.default_bridge
+
+ if self.modify_etc_hosts is None:
+ self.modify_etc_hosts = True
+
+ if self.modify_ssh_setup is None:
+ self.modify_ssh_setup = True
+
+ # default_bridge is no longer used it 2.1. The slot is left there to
+ # support auto-upgrading, but will be removed in 2.2
+ if self.default_bridge is not None:
+ self.default_bridge = None
+
+ # default_hypervisor is just the first enabled one in 2.1
+ if self.default_hypervisor is not None:
+ self.enabled_hypervisors = ([self.default_hypervisor] +
+ [hvname for hvname in self.enabled_hypervisors
+ if hvname != self.default_hypervisor])
+ self.default_hypervisor = None
+
+ # maintain_node_health added after 2.1.1
+ if self.maintain_node_health is None:
+ self.maintain_node_health = False
+
+ if self.uid_pool is None:
+ self.uid_pool = []