network topology crashes with timing issue

Bug #1304600 reported by Matthew D. Wood
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Matthew D. Wood

Bug Description

Due to a timing issue, the network topology page can issue a 500 error if a subnet is deleted at the inopportune moment.

Inside openstack_dashboard/dashboards/project/network_topology/views.py ---> JSONView.get method

neutron_networks = api.neutron.network_list_for_tenant(
                request,
                request.user.tenant_id)

This can return a list of network objects whose subnet list can be [None]

Later, we attempt to iterate over that list and pull the .cidr attribute off each element:

...
                    'subnets': [{'cidr': subnet.cidr}
                                for subnet in network.subnets],
...

Obviously, None doesn't have a .cidr attribute.

The real cause is inside the api.neutron.network_list_for_tenant call above. Each network's list of subnets should never include None.

Changed in horizon:
assignee: nobody → Matthew D. Wood (woodm1979)
Revision history for this message
Ana Krivokapić (akrivoka) wrote :
Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/86123
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=edcbb401c5eeb42fbbfd8651c31c571b4c3e5139
Submitter: Jenkins
Branch: master

commit edcbb401c5eeb42fbbfd8651c31c571b4c3e5139
Author: woodm1979 <email address hidden>
Date: Tue Apr 8 13:04:11 2014 -0600

    Network topology crashes with timing issue

    Due to a timing issue, the network topology page can issue a 500 error
    if a subnet is deleted at the inopportune moment.

    Inside openstack_dashboard/dashboards/project/network_topology/views.py
    ---> JSONView.get method:

    neutron_networks = api.neutron.network_list_for_tenant(
                    request,
                    request.user.tenant_id)

    This can return a list of network objects whose subnet list can be [None]

    Later, we attempt to iterate over that list and pull the .cidr attribute
    off each element:

    ...
                        'subnets': [{'cidr': subnet.cidr}
                                    for subnet in network.subnets],
    ...

    Obviously, None doesn't have a .cidr attribute.

    The real cause is inside the api.neutron.network_list_for_tenant call
    above. Each network's list of subnets should never include None.

    Change-Id: Ia88c5821bec73c80c4e743180354a69dabc93735
    Closes-Bug: 1304600

Changed in horizon:
status: In Progress → Fix Committed
Changed in horizon:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: juno-2 → 2014.2
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.