def update_dict_key_value(
        in_dict,
        keys,
        value,
        delimiter=DEFAULT_TARGET_DELIM,
        ordered_dict=False):
    '''
    Ensures that in_dict contains the series of recursive keys defined in keys.
    Also updates the dict, that is at the end of `in_dict` traversed with `keys`,
    with `value`.

    :param dict in_dict: The dictionary to work with
    :param str keys: The delimited string with one or more keys.
    :param any value: The value to update the nested dict-key with.
    :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 dict: Though it updates in_dict in-place.
    '''
    dict_pointer, last_key = _dict_rpartition(in_dict,
                                              keys,
                                              delimiter=delimiter,
                                              ordered_dict=ordered_dict)
    if last_key not in dict_pointer or dict_pointer[last_key] is None:
        dict_pointer[last_key] = OrderedDict() if ordered_dict else {}
    try:
        dict_pointer[last_key].update(value)
    except AttributeError:
        raise SaltInvocationError('The last key contains a {}, which cannot update.'
                                  ''.format(type(dict_pointer[last_key])))
    except (ValueError, TypeError):
        raise SaltInvocationError('Cannot update {} with a {}.'
                                  ''.format(type(dict_pointer[last_key]), type(value)))
    return in_dict
def update_dict_key_value ( in_dict , keys , value , delimiter = DEFAULT_TARGET_DELIM , ordered_dict = False ) : dict_pointer , last_key = _dict_rpartition ( in_dict , keys , delimiter = delimiter , ordered_dict = ordered_dict ) if last_key not in dict_pointer or dict_pointer [ last_key ] is None : dict_pointer [ last_key ] = OrderedDict ( ) if ordered_dict else { } try : dict_pointer [ last_key ] . update ( value ) except AttributeError : raise SaltInvocationError ( 'The last key contains a {}, which cannot update.' '' . format ( type ( dict_pointer [ last_key ] ) ) ) except ( ValueError , TypeError ) : raise SaltInvocationError ( 'Cannot update {} with a {}.' '' . format ( type ( dict_pointer [ last_key ] ) , type ( value ) ) ) return in_dict
Ensures that in_dict contains the series of recursive keys defined in keys.
    Also updates the dict, that is at the end of `in_dict` traversed with `keys`,
    with `value`.

    :param dict in_dict: The dictionary to work with
    :param str keys: The delimited string with one or more keys.
    :param any value: The value to update the nested dict-key with.
    :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 dict: Though it updates in_dict in-place.