Commit 753401b6 authored by Aurélien Dunand's avatar Aurélien Dunand Committed by Sébastien Luttringer
Browse files

Handle missing parameter in description



Image and version are required, so an error is raised if missing.
Description, author and is_min_version are optional, so update their default
value.

Signed-off-by: default avatarSébastien Luttringer <sebastien.luttringer@smartjog.com>
parent 14763ddd
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -535,11 +535,12 @@ class SourceImage(Image):
            # Else, it returns a list of (section, optname, error)
            if res is not True:
                for section, optname, error in flatten_errors(cp, res):
                    # If error is False, this mean no value as been supplied,
                    # so we use the default value
                    # Else, the check has failed
                    # If error, the check has failed
                    if error:
                        error('Wrong description file, %s %s: %s' % (section, optname, error))
                    # Else, no value has been supplied and there is no default value
                    else:
                        error(u"No option '%s' in section '%s'" % (optname, section[0]))
            for n in ("name", "version", "description", "author", "is_min_version"):
                d[n] = cp["image"][n]
            d["compressor"] = {}
@@ -661,9 +662,9 @@ DESCRIPTION_CONFIG_SPEC = """\
[image]
name = IS_name
version = IS_version
description = string
author = string
is_min_version = IS_min_version
description = string(default='')
author = string(default='')
is_min_version = IS_min_version(default=0)

[compressor]
__many__ = force_list