def METHOD_NAME(name, METHOD_NAME):
    """
    Ensure that the marathon app with the given id is present and is configured
    to match the given config values.
    :param name: The app name/id
    :param config: The configuration to apply (dict)
    :return: A standard Salt changes dictionary
    """
    # setup return structure
    ret = {
        "name": name,
        "changes": {},
        "result": False,
        "comment": "",
    }
    # get existing config if app is present
    existing_config = None
    if __salt__["marathon.has_app"](name):
        existing_config = __salt__["marathon.app"](name)["app"]
    # compare existing config with defined config
    if existing_config:
        update_config = copy.deepcopy(existing_config)
        salt.utils.configcomparer.compare_and_update_config(
            METHOD_NAME,
            update_config,
            ret["changes"],
        )
    else:
        # the app is not configured--we need to create it from scratch
        ret["changes"]["app"] = {
            "new": METHOD_NAME,
            "old": None,
        }
        update_config = METHOD_NAME
    # update the config if we registered any changes
    if ret["changes"]:
        # if test, report there will be an update
        if __opts__["test"]:
            ret["result"] = None
            ret["comment"] = "Marathon app {} is set to be updated".format(name)
            return ret
        update_result = __salt__["marathon.update_app"](name, update_config)
        if "exception" in update_result:
            ret["result"] = False
            ret["comment"] = "Failed to update app config for {}: {}".format(
                name,
                update_result["exception"],
            )
            return ret
        else:
            ret["result"] = True
            ret["comment"] = "Updated app config for {}".format(name)
            return ret
    ret["result"] = True
    ret["comment"] = "Marathon app {} configured correctly".format(name)
    return ret