def action_parse_results(result):
    """Parse the result of `run` in the context of an action.

    :param result: The result of running the security-checklist
        action on a unit
    :type result: Dict[str, Dict[str, str]]
    :rtype: int
    """
    passed = True
    for test, result in result.items():
        if result['success']:
            hookenv.action_set({test: 'PASS'})
        else:
            hookenv.action_set({test: 'FAIL - {}'.format(result['message'])})
            passed = False
    if not passed:
        hookenv.action_fail("One or more tests failed")
    return 0 if passed else 1
Parse the result of `run` in the context of an action.

    :param result: The result of running the security-checklist
        action on a unit
    :type result: Dict[str, Dict[str, str]]
    :rtype: int