Commit 4b97458c authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix cluster ispecs on upgrade



Cluster-level parameters must *not* be empty. Plus two more minor
changes.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent b32f3c0c
......@@ -97,7 +97,7 @@ def FillDictOfDicts(defaults_dict, custom_dict, skip_keys=None):
"""
ret_dict = {}
for key in defaults_dict.keys():
for key in defaults_dict:
ret_dict[key] = FillDict(defaults_dict[key],
custom_dict.get(key, {}),
skip_keys=skip_keys)
......@@ -1299,8 +1299,8 @@ class NodeGroup(TaggableObject):
if self.alloc_policy is None:
self.alloc_policy = constants.ALLOC_POLICY_PREFERRED
# We only update mtime, and not ctime, since we would not be able to provide
# a correct value for creation time.
# We only update mtime, and not ctime, since we would not be able
# to provide a correct value for creation time.
if self.mtime is None:
self.mtime = time.time()
......@@ -1473,7 +1473,7 @@ class Cluster(TaggableObject):
# instance policy added before 2.6
if self.ipolicy is None:
self.ipolicy = MakeEmptyIPolicy()
self.ipolicy = FillDictOfDicts(constants.IPOLICY_DEFAULTS, {})
@property
def primary_hypervisor(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment