Helper function to:
    - Ensure all but the last key in `keys` exist recursively in `in_dict`.
    - Return the dict at the one-to-last key, and the last key

    :param dict in_dict: The dict to work with.
    :param str keys: The delimited string with one or more keys.
    :param str delimiter: The delimiter to use in `keys`. Defaults to ':'.
    :param bool ordered_dict: Create OrderedDicts if keys are missing.
                              Default: create regular dicts.

    :return tuple(dict, str)

def _dict_rpartition(
        in_dict,
        keys,
        delimiter=DEFAULT_TARGET_DELIM,
        ordered_dict=False):
    '''
    Helper function to:
    - Ensure all but the last key in `keys` exist recursively in `in_dict`.
    - Return the dict at the one-to-last key, and the last key

    :param dict in_dict: The dict to work with.
    :param str keys: The delimited string with one or more keys.
    :param str delimiter: The delimiter to use in `keys`. Defaults to ':'.
    :param bool ordered_dict: Create OrderedDicts if keys are missing.
                              Default: create regular dicts.

    :return tuple(dict, str)
    '''
    if delimiter in keys:
        all_but_last_keys, _, last_key = keys.rpartition(delimiter)
        ensure_dict_key(in_dict,
                        all_but_last_keys,
                        delimiter=delimiter,
                        ordered_dict=ordered_dict)
        dict_pointer = salt.utils.data.traverse_dict(in_dict,
                                                     all_but_last_keys,
                                                     default=None,
                                                     delimiter=delimiter)
    else:
        dict_pointer = in_dict
        last_key = keys
    return dict_pointer, last_key