Example #1
0
def _linux_init():

    import ovsdb 
    state = ovsdb.get_current_state()
    __n__['logger'].debug("Linux init, current_state: " + str(state))
    exit = 0

    for module in __n__['state_order']:

        model = None

        if module in __n__['indexes'] and module in state:
            ind_key = __n__['indexes'][module]
            for d in state[module]: # dict in the list
                d['_index'] = [ind_key, d[ind_key]] # Adds _index
            model = {module: state[module]}
        elif module in state:
            model = {module: state[module]}

        if model:
            __n__['logger'].info("Linux init, model: " + str(model))
            exit = _route('add', model) 
            if exit > 0:
                return exit

    return exit
Example #2
0
def _linux_init():

    import ovsdb
    state = ovsdb.get_current_state()
    __n__['logger'].debug("Linux init, current_state: " + str(state))
    exit = 0

    for module in __n__['state_order']:

        model = None

        if module in __n__['indexes'] and module in state:
            ind_key = __n__['indexes'][module]
            for d in state[module]:  # dict in the list
                d['_index'] = [ind_key, d[ind_key]]  # Adds _index
            model = {module: state[module]}
        elif module in state:
            model = {module: state[module]}

        if model:
            __n__['logger'].info("Linux init, model: " + str(model))
            exit = _route('add', model)
            if exit > 0:
                return exit

    return exit
Example #3
0
def state():
    return ovsdb.get_current_state() 
Example #4
0
def state():
    return ovsdb.get_current_state()