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 <>
Reviewed-by: default avatarHelga Velroyen <>
parent 1d4a4b26
......@@ -1223,6 +1223,8 @@ class Instance(TaggableObject):
if self.osparams is None:
self.osparams = {}
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.
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