Commit b1a38185 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Correctly downgrade the new node paramter

In other words, remove "cpu_speed" from all "nodeparams"
where it is present, be it cluster, group, or node. Note
that upgrading is no problem, as the default value will
be used implicitly.
Signed-off-by: default avatarKlaus Aehlig <>
Reviewed-by: default avatarPetr Pudlak <>
parent 8fd6c773
...@@ -405,12 +405,19 @@ def UpgradeAll(config_data): ...@@ -405,12 +405,19 @@ def UpgradeAll(config_data):
# DOWNGRADE ------------------------------------------------------------ # DOWNGRADE ------------------------------------------------------------
def DowngradeNodeParams(config_object):
if "ndparams" in config_object:
if "cpu_speed" in config_object["ndparams"]:
del config_object["ndparams"]["cpu_speed"]
def DowngradeCluster(config_data): def DowngradeCluster(config_data):
cluster = config_data.get("cluster", None) cluster = config_data.get("cluster", None)
if not cluster: if not cluster:
raise Error("Cannot find the 'cluster' key in the configuration") raise Error("Cannot find the 'cluster' key in the configuration")
if "osparams_private_cluster" in cluster: if "osparams_private_cluster" in cluster:
del cluster["osparams_private_cluster"] del cluster["osparams_private_cluster"]
...@@ -421,6 +428,16 @@ def DowngradeCluster(config_data): ...@@ -421,6 +428,16 @@ def DowngradeCluster(config_data):
del cluster["zeroing_image"] del cluster["zeroing_image"]
def DowngradeGroups(config_data):
for group in config_data["nodegroups"].values():
def DowngradeNodes(config_data):
for group in config_data["nodes"].values():
def DowngradeInstances(config_data): def DowngradeInstances(config_data):
instances = config_data.get("instances", None) instances = config_data.get("instances", None)
if instances is None: if instances is None:
...@@ -437,6 +454,8 @@ def DowngradeAll(config_data): ...@@ -437,6 +454,8 @@ def DowngradeAll(config_data):
config_data["version"] = version.BuildVersion(DOWNGRADE_MAJOR, config_data["version"] = version.BuildVersion(DOWNGRADE_MAJOR,
DowngradeCluster(config_data) DowngradeCluster(config_data)
DowngradeInstances(config_data) DowngradeInstances(config_data)
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