during get_auto_allocated_topology no extension attributes are send during router-create

Bug #1699496 reported by Wim De Clercq
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
New
Undecided
Unassigned

Bug Description

At https://github.com/openstack/neutron/blob/master/neutron/services/auto_allocate/db.py#L307:

**********************************************************************
router_args = {
    'name': 'auto_allocated_router',
    l3.EXTERNAL_GW_INFO: {'network_id': default_external_network},
    'tenant_id': tenant_id,
    'admin_state_up': True
}
router = None
attached_subnets = []
try:
    router = self.l3_plugin.create_router(
        context, {'router': router_args})
**********************************************************************

The router_args send to the l3 plugin are missing extension attributes if router extensions exist.
The fix is to add these before calling .create_router:

**********************************************************************
from neutron.plugins.common import utils as plugin_utils

router_args = plugin_utils._fixup_res_dict(context,
                                           'routers',
                                           router_args)
router = self.l3_plugin.create_router(
    context, {'router': router_args})
**********************************************************************

Revision history for this message
Brian Haley (brian-haley) wrote :

I thought the DB code took care of this? At the end of _make_router_dict(), called from create_router():

    if process_extensions:
        resource_extend.apply_funcs(l3.ROUTERS, res, router)

I'm sure I'm missing something...

Revision history for this message
Wim De Clercq (wim-de-clercq) wrote :

That is for the response only though. Normally the router that enters the create_router function should already have all defaults applied as set in the attributes dict.

I have router extensions, and the code in create_router isn't and shouldn't be supporting a router coming it without defaults applied.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.