LGTM, thanks On Wed, Oct 8, 2014 at 11:16 AM, 'Hrvoje Ribicic' via ganeti-devel < ganeti-devel@googlegroups.com> wrote:
> So far Ganeti has had only one version of the description produced when > an instance is exported. Due to this, the code does not deal with > forward or backward compatibility right now, and assumes that we cannot > import an instance that does not have the same export version at stated > in the constants. > > This requirement of version equality is introduced more explicitly in > this patch, by both enhancing the documentation of the constant, and > explicitly exporting the instances with the version stated in the > constants. > > Signed-off-by: Hrvoje Ribicic <r...@google.com> > --- > lib/backend.py | 2 +- > src/Ganeti/Constants.hs | 3 +++ > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/lib/backend.py b/lib/backend.py > index 33563e9..8b465eb 100644 > --- a/lib/backend.py > +++ b/lib/backend.py > @@ -3935,7 +3935,7 @@ def FinalizeExport(instance, snap_disks): > config = objects.SerializableConfigParser() > > config.add_section(constants.INISECT_EXP) > - config.set(constants.INISECT_EXP, "version", "0") > + config.set(constants.INISECT_EXP, "version", > str(constants.EXPORT_VERSION)) > config.set(constants.INISECT_EXP, "timestamp", "%d" % int(time.time())) > config.set(constants.INISECT_EXP, "source", instance.primary_node) > config.set(constants.INISECT_EXP, "os", instance.os) > diff --git a/src/Ganeti/Constants.hs b/src/Ganeti/Constants.hs > index 3709b2d..2ea0cbb 100644 > --- a/src/Ganeti/Constants.hs > +++ b/src/Ganeti/Constants.hs > @@ -173,6 +173,9 @@ osApiV20 = 20 > osApiVersions :: FrozenSet Int > osApiVersions = ConstantUtils.mkSet [osApiV10, osApiV15, osApiV20] > > +-- | The version of the backup/export instance description file format we > are > +-- producing when exporting and accepting when importing. The two are > currently > +-- tightly intertwined. > exportVersion :: Int > exportVersion = 0 > > -- > 2.1.0.rc2.206.gedb03e5 > > -- Helga Velroyen | Software Engineer | hel...@google.com | 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