

def initialize_legacy_extensions(legacy_extensions):
    leftovers = []
    for ext in legacy_extensions:
        ext_resources = ext.get_resources()
        for ext_resource in ext_resources:
            controller = ext_resource.controller.controller
            collection = ext_resource.collection
            resource = _handle_plurals(collection)
            if manager.NeutronManager.get_plugin_for_resource(resource):
                continue
            if manager.NeutronManager.get_plugin_for_resource(collection):
                continue
            leftovers.append((collection, resource, controller))
    for leftover in leftovers:
        shim_controller = utils.ShimCollectionsController(*leftover)
        manager.NeutronManager.set_controller_for_resource(shim_controller.collection, shim_controller)

dataset/ETHPy150Open openstack/neutron/neutron/pecan_wsgi/startup.py initialize_legacy_extensions/original