Hi Sebastian, * Sebastian Gebhard <[email protected]> [2013-07-14 17:05:11 +0200]:
> 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 > I think vlan is part of nicparams and not nic object right. After a quick read I quess here should be something like: nic["nicparams"]["vlan"] = None. But nicparams are filled upon config read. So if you define "" for default you do not have to cfgupgrade. Search for SimpleFillNIC() to verify. > 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) Same here. nic["nicparams"].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") > -- Hope it helps, dimara > 1.8.1.2
signature.asc
Description: Digital signature
