d1763fc checks.py: support 'append' option

Authored and Committed by qwan 7 years ago
    checks.py: support 'append' option
    
    If 'append' is defined for a property, append the values from append
    options to the property. Note: The property must support to be a list
    of values.
    
    For example:
    
    with schema:
    
        schema = {
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Pungi Configuration",
            "type": "object",
            "definitions": {
                "list_of_strings": {
                    "type": "array",
                    "items": {"type": "string"},
                },
                "strings": {
                    "anyOf": [
                        {"type": "string"},
                        {"$ref": "#/definitions/list_of_strings"},
                    ]
                },
            },
            "properties": {
                "release_name": {"type": "string"},
                "repo": {"$ref": "#/definitions/strings", "append": "repo_from"}
            },
            "additionalProperties": False,
        }
    
    and config:
    
        repo = "http://url/to/repo"
        repo_from = "Server"
    
    config will be updated to:
    
        repo = ["http://url/to/repo", "Server"]
    
    It supports multiple append options too, like:
    
        "repo": {
            "$ref": "#/definitions/strings",
            "append": ["repo_from", "source_repo_from"],
        }
    
    Signed-off-by: Qixiang Wan <qwan@redhat.com>
    
        
file modified
+25 -2
file modified
+124 -0