def _check_return_value(ret):
    """
    Helper function to check if the 'result' key of the return value has been
    properly set. This is to detect unexpected code-paths that would otherwise
    return a 'success'-y value but not actually be succesful.

    :param dict ret: The returned value of a state function.
    """
    if ret["result"] == "oops":
        ret["result"] = False
        ret["comment"].append(
            "An internal error has occurred: The result value was "
            "not properly changed."
        )
    return ret