From 5e40d8e2b43fb9afed3f67b64ed87890f2062a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Wed, 12 Jun 2013 15:25:55 +0200 Subject: [PATCH] Bump image format to 2.0 This introduce the new image format version in X.Y by upgrade from 1 to 2.0. Where X is an image forward compatibility breaking and Y a revision. The new format is needed because we move versionning from number to string --- installsystems/image.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/installsystems/image.py b/installsystems/image.py index 94f8d3f..722b560 100644 --- a/installsystems/image.py +++ b/installsystems/image.py @@ -68,9 +68,6 @@ class Image(object): Abstract class of images ''' - # format should be a float X.Y but for compatibility reason it's a string - # before version 6, it's strict string comparaison - format = "1" extension = ".isimage" default_compressor = "gzip" @@ -238,6 +235,11 @@ class SourceImage(Image): Image source manipulation class ''' + # format should be a float X.Y but for compatibility reason it's a string + # before version 6, it's strict string comparaison + format = "2.0" + + @classmethod def create(cls, path, force=False): ''' @@ -862,7 +864,7 @@ class PackageImage(Image): # check format img_format = self._tarball.get_utf8("format") try: - if float(img_format) >= math.floor(float(self.format)) + 1.0: + if float(img_format) >= math.floor(float(SourceImage.format)) + 1.0: raise Exception() except: raise ISError(u"Invalid image format %s" % img_format) -- GitLab