コード例 #1
0
def execute_with_output(check: Check) -> CheckResult:
    print_processing(check.msg)

    try:
        result = check.execute()
    finally:
        stop_processing_spinner()

    if result.result == result.should_succeed:
        print_passed(check.msg)
    else:
        print_failed(check.msg, result.warning, result.output, result.command)

    return result
コード例 #2
0
def record_result(result,
                  msg,
                  output,
                  warning,
                  should_succeed=True,
                  command=None,
                  mandatory=False):
    global results

    stop_processing_spinner()

    results.append((result, should_succeed, mandatory))

    if result == should_succeed:
        print_passed(msg)
    else:
        print_failed(msg, command, output, warning)