Commit 302f585c authored by Klaus Aehlig's avatar Klaus Aehlig

Auto-upgrade hv_state_static and disk_state_static

These cluster parameters were introduced in 2da9f556
without being added to the parameters implicitly upgraded
if missing. This now causes problems when upgrading pre-2.6
clusters to 2.11 or later where this parameter is assumed
to be a dictionary. So add the implicit upgrade.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent f3aff42b
......@@ -1719,6 +1719,12 @@ class Cluster(TaggableObject):
raise errors.ConfigurationError(msg)
self.ipolicy = FillIPolicy(constants.IPOLICY_DEFAULTS, self.ipolicy)
# hv_state_static added in 2.7
if self.hv_state_static is None:
self.hv_state_static = {}
if self.disk_state_static is None:
self.disk_state_static = {}
@property
def primary_hypervisor(self):
"""The first hypervisor is the primary.
......
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