PTU5KAS/kas
Claudius Heine 75fa095aa5 config: Added schema validation for configuration files
Currently many of the error messages regarding the configuration file
are not really helpful.

To improve reporting this patch adds validation of the configuration
files using the jsonschema module.

Example:

  Forgetting ':' at the end of a layer definition, like this:

    repos:
      meta-iot2000:
        layers:
          meta-iot2000-example
                              ^

  Exception before:

    TypeError: string indices must be integers

  Exception after:

    Validation Error:
     'meta-iot2000-example' is not of type 'object'

     Failed validating 'type' in schema['properties']['repos']['additionalProperties']['properties']['layers']:
         {'additionalProperties': {'oneOf': [{'type': 'null'},
                                             {'type': 'integer'},
                                             {'type': 'boolean'},
                                             {'type': 'string'}]},
          'type': 'object'}

     On instance['repos']['meta-iot2000']['layers']:
         'meta-iot2000-example'

This patch adds 'jsonschema' as an additional dependency.

Signed-off-by: Claudius Heine <ch@denx.de>
2017-10-13 14:11:10 +02:00
..
__init__.py config: Added schema validation for configuration files 2017-10-13 14:11:10 +02:00
__main__.py entry: Consistently call python3 2017-08-31 22:31:41 +02:00
__version__.py config: Implemented multi-target support 2017-10-13 14:11:00 +02:00
build.py config: Implemented multi-target support 2017-10-13 14:11:00 +02:00
config.py config: Implemented multi-target support 2017-10-13 14:11:00 +02:00
configschema.py config: Added schema validation for configuration files 2017-10-13 14:11:10 +02:00
includehandler.py config: Added schema validation for configuration files 2017-10-13 14:11:10 +02:00
kas.py entry: Consistently call python3 2017-08-31 22:31:41 +02:00
libcmds.py libcmds: Remove unused pre and post hooks 2017-09-27 10:49:35 +02:00
libkas.py libkas: do not use absolute paths when executing programs 2017-09-11 10:19:09 +02:00
repos.py Fixed issues that occured with pylint 1.7.2 2017-06-28 15:10:14 +02:00
shell.py config: Implemented multi-target support 2017-10-13 14:11:00 +02:00