Commit 5e40d8e2 authored by Sébastien Luttringer's avatar Sébastien Luttringer
Browse files

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
parent 0f1bba36
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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)