Commit 89c910fd authored by Michele Tartara's avatar Michele Tartara
Browse files

Fix the downgrade function of cfgupgrade



The downgrade was not correctly removing some of the UUIDs (namely, those
of disks and NICs).

Fixes Issue 510.
Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent d27458ce
......@@ -309,6 +309,14 @@ def DowngradeCluster(config_data):
DowngradeIPolicy(ipolicy, "cluster")
def DowngradeDisk(disk):
if "uuid" in disk:
del disk["uuid"]
if "children" in disk:
for child_disk in disk["children"]:
DowngradeDisk(child_disk)
def DowngradeInstances(config_data):
if "instances" not in config_data:
raise Error("Can't find the 'instances' key in the configuration!")
......@@ -317,6 +325,15 @@ def DowngradeInstances(config_data):
if "disks_active" in iobj:
del iobj["disks_active"]
# Remove the NICs UUIDs
for nic in iobj["nics"]:
if "uuid" in nic:
del nic["uuid"]
# Downgrade the disks
for disk in iobj["disks"]:
DowngradeDisk(disk)
def DowngradeAll(config_data):
# Any code specific to a particular version should be labeled that way, so
......
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