This patch updates cfgupgrade to support the vlan parameter in
upgrade and downgrade

Signed-off-by: Sebastian Gebhard <[email protected]>
---
 tools/cfgupgrade | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/cfgupgrade b/tools/cfgupgrade
index 554877f..bdec77b 100755
--- a/tools/cfgupgrade
+++ b/tools/cfgupgrade
@@ -189,6 +189,7 @@ def UpgradeInstances(config_data):
           print("NIC with network name %s found."
                 " Substituting with uuid %s." % (name, uuid))
           nic["network"] = uuid
+      nic["vlan"] = None 
 
     if "disks" not in iobj:
       raise Error("Instance '%s' doesn't have a disks entry?!" % instance)
@@ -368,6 +369,11 @@ def DowngradeInstances(config_data):
       raise Error("Cannot find 'disks' key for instance %s" % iname)
     DowngradeDisks(iobj["disks"], iname)
 
+    for nic in iobj["nics"]:
+      vlan = nic.get("vlan", None)
+      if vlan:
+        print("Instance with name %s found. Removing VLAN information %s." % \
+              (iname, vlan))
 
 def DowngradeNodeIndices(config_data):
   ChangeNodeIndices(config_data, "uuid", "name")
-- 
1.8.1.2

Reply via email to