Ejemplo n.º 1
0
def delete_object_config(obj_type, obj_id):
    before_metasection, metasection, after_metasection = extract_config_sections(
    )

    metasection = remove_object_from_metasection(metasection, obj_type, obj_id)

    merge_config_sections(before_metasection, metasection, after_metasection)
Ejemplo n.º 2
0
def delete_transient_object_configs():
    before_metasection, metasection, after_metasection = extract_config_sections(
    )

    new_metasection = remove_transient_conflines_from_metasection(metasection)

    merge_config_sections(before_metasection, new_metasection,
                          after_metasection)
Ejemplo n.º 3
0
def add_object_config(obj_type, obj):

     before_metasection, metasection, after_metasection = extract_config_sections()

     metasection, obj_id = update_metasection_with_new_object(metasection, obj_type, obj)

     merge_config_sections(before_metasection, metasection, after_metasection)

     return obj_id
Ejemplo n.º 4
0
def add_object_config(obj_type, obj):

    before_metasection, metasection, after_metasection = extract_config_sections(
    )

    metasection, obj_id = update_metasection_with_new_object(
        metasection, obj_type, obj)

    merge_config_sections(before_metasection, metasection, after_metasection)

    return obj_id
Ejemplo n.º 5
0
def update_object_config(obj_type, obj_id, current_obj, obj_updates):
    # Before merging current state with new state, remove any 
    # meta-attributes added during get_object_config()
    if TRANSIENT_META_FIELD in current_obj:
        del current_obj[TRANSIENT_META_FIELD]

    updated_obj = _merge_updates_into_new_obj(current_obj, obj_updates)

    before_metasection, metasection, after_metasection = extract_config_sections()

    updated_obj_str = _convert_obj_to_string(obj_type, obj_id, updated_obj)

    metasection = update_metasection_with_updated_object(metasection, obj_type, obj_id, updated_obj_str)

    merge_config_sections(before_metasection, metasection, after_metasection)

    return updated_obj
Ejemplo n.º 6
0
def update_object_config(obj_type, obj_id, current_obj, obj_updates):
    # Before merging current state with new state, remove any
    # meta-attributes added during get_object_config()
    if TRANSIENT_META_FIELD in current_obj:
        del current_obj[TRANSIENT_META_FIELD]

    updated_obj = _merge_updates_into_new_obj(current_obj, obj_updates)

    before_metasection, metasection, after_metasection = extract_config_sections(
    )

    updated_obj_str = _convert_obj_to_string(obj_type, obj_id, updated_obj)

    metasection = update_metasection_with_updated_object(
        metasection, obj_type, obj_id, updated_obj_str)

    merge_config_sections(before_metasection, metasection, after_metasection)

    return updated_obj
Ejemplo n.º 7
0
def delete_transient_object_configs():
    before_metasection, metasection, after_metasection = extract_config_sections()
    
    new_metasection = remove_transient_conflines_from_metasection(metasection)
    
    merge_config_sections(before_metasection, new_metasection, after_metasection)
Ejemplo n.º 8
0
def delete_object_config(obj_type, obj_id):
     before_metasection, metasection, after_metasection = extract_config_sections()

     metasection = remove_object_from_metasection(metasection, obj_type, obj_id)
     
     merge_config_sections(before_metasection, metasection, after_metasection)