Beispiel #1
0
def full_sync(context):
    if not _full_sync_needed(context):
        return

    db.delete_pending_rows(context.session, _OPS_TO_DELETE_ON_SYNC)

    for resource_type in _ORDERED_ODL_RESOURCES:
        handler = FULL_SYNC_RESOURCES.get(resource_type)
        if handler:
            _sync_resources(context, resource_type, handler)

    journal.record(context, odl_const.ODL_NETWORK, _CANARY_NETWORK_ID,
                   odl_const.ODL_CREATE, _CANARY_NETWORK_DATA)
Beispiel #2
0
def full_sync(context):
    if not _full_sync_needed(context):
        return

    db.delete_pending_rows(context, _OPS_TO_DELETE_ON_SYNC)

    for resource_type in _ORDERED_ODL_RESOURCES:
        handler = FULL_SYNC_RESOURCES.get(resource_type)
        if handler:
            _sync_resources(context, resource_type, handler)

    journal.record(context, odl_const.ODL_NETWORK, _CANARY_NETWORK_ID,
                   odl_const.ODL_CREATE, _CANARY_NETWORK_DATA)
Beispiel #3
0
def full_sync(session):
    if not _full_sync_needed(session):
        return

    db.delete_pending_rows(session, _OPS_TO_DELETE_ON_SYNC)

    dbcontext = neutron_context.get_admin_context()
    plugin = manager.NeutronManager.get_plugin()
    for resource_type, collection_name in _RESOURCES_TO_SYNC:
        _sync_resources(session, plugin, dbcontext, resource_type,
                        collection_name)
    db.create_pending_row(session, odl_const.ODL_NETWORK, _CANARY_NETWORK_ID,
                          odl_const.ODL_CREATE, _CANARY_NETWORK_DATA)
Beispiel #4
0
def full_sync(context):
    if not _full_sync_needed(context):
        return

    db.delete_pending_rows(context.session, _OPS_TO_DELETE_ON_SYNC)

    for resource_type in _ORDERED_ODL_RESOURCES:
        for plugin_alias, resource in ALL_RESOURCES.items():
            collection_name = resource.get(resource_type)
            if collection_name is not None:
                plugin = directory.get_plugin(plugin_alias)
                _sync_resources(plugin, context, resource_type,
                                collection_name)
                break

    journal.record(context, odl_const.ODL_NETWORK, _CANARY_NETWORK_ID,
                   odl_const.ODL_CREATE, _CANARY_NETWORK_DATA)
def full_sync(session):
    if not _full_sync_needed(session):
        return

    db.delete_pending_rows(session, _OPS_TO_DELETE_ON_SYNC)

    dbcontext = neutron_context.get_admin_context()
    plugin = directory.get_plugin()
    for resource_type, collection_name in odl_const.L2_RESOURCES.items():
        _sync_resources(session, plugin, dbcontext, resource_type,
                        collection_name)

    l3plugin = directory.get_plugin(constants.L3)
    for resource_type, collection_name in odl_const.L3_RESOURCES.items():
        _sync_resources(session, l3plugin, dbcontext, resource_type,
                        collection_name)

    journal.record(dbcontext, odl_const.ODL_NETWORK, _CANARY_NETWORK_ID,
                   odl_const.ODL_CREATE, _CANARY_NETWORK_DATA)