LGTM, thanks On Thu, Apr 23, 2015 at 3:19 PM, 'Klaus Aehlig' via ganeti-devel < [email protected]> wrote:
> Old versions of Ganeti (in particular, 2.5 and earlier) did not > have UUIDs assigned to objects. If we happen to find such an old > configuration, we assign UUIDs now, during the upgrade. However, > we must do this recursively, as disks might have children. Note > that before Ganeti 2.12 this didn't matter, as the UUIDs of the > children where never used or enforced. With the strict type checking > introduced by the switch to haskell, we have to care about those > little details. > > Signed-off-by: Klaus Aehlig <[email protected]> > --- > tools/cfgupgrade | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/tools/cfgupgrade b/tools/cfgupgrade > index c8dfdec..a42b94a 100755 > --- a/tools/cfgupgrade > +++ b/tools/cfgupgrade > @@ -241,6 +241,14 @@ def _ConvertNicNameToUuid(iobj, network2uuid): > nic["network"] = uuid > > > +def AssignUuid(disk): > + if not "uuid" in disk: > + disk["uuid"] = utils.io.NewUUID() > + if "children" in disk: > + for d in disk["children"]: > + AssignUuid(d) > + > + > def _ConvertDiskAndCheckMissingSpindles(iobj, instance): > missing_spindles = False > if "disks" not in iobj: > @@ -265,8 +273,7 @@ def _ConvertDiskAndCheckMissingSpindles(iobj, > instance): > if not "spindles" in dobj: > missing_spindles = True > > - if not "uuid" in dobj: > - dobj["uuid"] = utils.io.NewUUID() > + AssignUuid(dobj) > return missing_spindles > > > -- > 2.2.0.rc0.207.ga3a616c > > Hrvoje Ribicic Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores Steuernummer: 48/725/00206 Umsatzsteueridentifikationsnummer: DE813741370
