def _outcome_table_schema()

in lib/validation.py [0:0]


def _outcome_table_schema():
    import voluptuous

    return {
        voluptuous.Optional("comment"): str,
        # A description of the outcome table as a whole.

        "outcomes": [
        # The outcome of the job will be the first item in this list that
        # matches.

            voluptuous.Any({
                "type": "return-code",
                # If the return code of the job matches the value of *value*,
                # the outcome will be set to the value of *action*. The value
                # of the optional *comment* key can contain a human-readable
                # explanation for this outcome.

                "value": int,

                "action": _outcome(),

                voluptuous.Optional("comment"): str,

            }, {
                "type": "timeout",
                # If this job timed out, the outcome will be set to the value of
                # *action*. The value of the optional *comment* key can contain
                # a human-readable explanation for this outcome.

                "action": _outcome(),

                voluptuous.Optional("comment"): str,

            }, {
                "type": "wildcard",
                # The *"wildcard"* action type matches any job and sets its
                # outcome to the value of *action*. It is recommended to place a
                # *wildcard* action as the last element of the list of
                # *outcomes* to catch all jobs that were not matched by a
                # previous rule.

                "action": _outcome(),

                voluptuous.Optional("comment"): str,

        })]
    }