pungi/pungi
Qixiang Wan c93207addb checks: extend validator with 'alias'
When a property has 'alias' defined, and it's not present in instance,
if the alias property is present, add the property with value from alias
property before remove the alias property from instance.

Examples:

with schema:
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "Pungi Configuration",
        "type": "object",
        "properties": {
            "release_name": {"type": "string", "alias": "product_name"},
        },
        "required": ["release_name"],
        "additionalProperties": False,
}

1. config = {"release_name": "dummy product"}:

   validate pass, config not changed after validation.

2. config = {"product_name": "dummy product"}:

   validate pass, config updated to the following after validation:

   config: {"release_name": "dummy product"}

3. config = {"name": "dummy product"}:

   validate fail, errror message is "Failed validation in : 'release_name' is a required property",
   and warning message is "WARNING: Unrecognized config option: name."

4. config = {"product_name": "dummy product", "release_name": "dummy product"}

   validate fail, error message is "Failed validation in : product_name is an alias of release_name, only one can be used."

Signed-off-by: Qixiang Wan <qwan@redhat.com>
2017-03-06 09:26:42 +08:00
..
compose_metadata Remove FSF address from comments 2016-09-23 10:26:43 +02:00
ostree ostree: Silence logger in tests 2017-02-23 11:08:31 +01:00
phases gather: Filter comps group on depsolving input of optional 2017-02-27 12:54:12 +01:00
wrappers util: Add a utility for managing temporary files 2017-02-20 09:14:25 +01:00
__init__.py not using 'git -C path' which is not supported by git 1.x 2016-10-25 15:53:56 +08:00
arch.py Remove FSF address from comments 2016-09-23 10:26:43 +02:00
checks.py checks: extend validator with 'alias' 2017-03-06 09:26:42 +08:00
compose.py handle opening empty images.json while re-running pungi-koji in debug mode 2017-02-16 17:00:14 +08:00
config.py pungi: Fix reading multilib config files 2016-11-09 09:36:23 +01:00
createiso.py iso-wrapper: Remove the class 2016-10-14 09:14:51 +02:00
gather.py pungi: Fix --nosource option 2016-12-13 10:45:05 +01:00
ks.py Remove FSF address from comments 2016-09-23 10:26:43 +02:00
linker.py Remove FSF address from comments 2016-09-23 10:26:43 +02:00
media_split.py Include phase name in log for some phases 2016-11-23 16:47:22 +08:00
metadata.py metadata: Fix .treeinfo paths for addons 2017-02-07 15:50:33 +01:00
multilib.py multilib: Remove FileMultilibMethod class 2017-02-10 12:32:45 +01:00
notifier.py Send notification when compose fails to start 2016-10-20 09:39:18 +02:00
pathmatch.py Remove FSF address from comments 2016-09-23 10:26:43 +02:00
paths.py Remove one line of log print 2017-03-02 11:46:33 +08:00
util.py util: Add a utility for managing temporary files 2017-02-20 09:14:25 +01:00