Skip to content
Snippets Groups Projects
Commit 77b60cdb authored by Guido Trotter's avatar Guido Trotter Committed by Iustin Pop
Browse files

Upgrade be/hv params with default values


From time to time we're adding new be or hv parameters. With this patch
missing parameters get set to the default value when loading the cluster
object. This patch version also considers the case when hv/be params
don't exist at all, and fixes a broken unit test triggered in that
case.

Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
(cherry picked from commit c1b42c18)
parent aafb303d
No related branches found
No related tags found
No related merge requests found
......@@ -759,6 +759,20 @@ class Cluster(TaggableObject):
"""Fill defaults for missing configuration values.
"""
if self.hvparams is None:
self.hvparams = constants.HVC_DEFAULTS
else:
for hypervisor in self.hvparams:
self.hvparams[hypervisor] = self.FillDict(
constants.HVC_DEFAULTS[hypervisor], self.hvparams[hypervisor])
if self.beparams is None:
self.beparams = {constants.BEGR_DEFAULT: constants.BEC_DEFAULTS}
else:
for begroup in self.beparams:
self.beparams[begroup] = self.FillDict(constants.BEC_DEFAULTS,
self.beparams[begroup])
if self.modify_etc_hosts is None:
self.modify_etc_hosts = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment