Commit a8e07057 authored by Thomas Thrainer's avatar Thomas Thrainer
Browse files

Consider disks_active in UpgradeConfig



The disks_active flag is updated when masterd reads the configuration.
Also, cfgupgrade now removes the disks_active flag during downgrades.
Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent 1d4a4b26
......@@ -1223,6 +1223,8 @@ class Instance(TaggableObject):
if self.osparams is None:
self.osparams = {}
UpgradeBeParams(self.beparams)
if self.disks_active is None:
self.disks_active = self.admin_state == constants.ADMINST_UP
class OS(ConfigObject):
......
......@@ -309,11 +309,21 @@ def DowngradeCluster(config_data):
DowngradeIPolicy(ipolicy, "cluster")
def DowngradeInstances(config_data):
if "instances" not in config_data:
raise Error("Can't find the 'instances' key in the configuration!")
for _, iobj in config_data["instances"].items():
if "disks_active" in iobj:
del iobj["disks_active"]
def DowngradeAll(config_data):
# Any code specific to a particular version should be labeled that way, so
# it can be removed when updating to the next version.
DowngradeCluster(config_data)
DowngradeGroups(config_data)
DowngradeInstances(config_data)
def main():
......
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