Commit 5e40d8e2 authored by Seblu's avatar Seblu

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
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment