unable to view details page of router if the router has more than one external gateways attached

Bug #1723007 reported by lahari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Invalid
Undecided
Unassigned

Bug Description

Unable to view details page of the router when more than one gateway interface is attached.

The same can be achieved in CLI through the following commands

neutron net-create --provider:network_type vlan --provider:physical_network default --provider:segmentation_id 3956 --router:external=True BAT-T0-bgw5

neutron subnet-create --name BAT-T0-bgw5-sub1 --gateway 11.127.0.1 --enable_dhcp=False BAT-T0-bgw5 11.127.0.0/29

neutron port-create BAT-T0-bgw5 --name BAT-T0-bgw5-bgw-port --device-owner baremetal:BGW-1 --binding:host_id BGW-1 --fixed-ip ip_address=11.127.0.1

neutron net-create --provider:network_type vlan --provider:physical_network default --provider:segmentation_id 3957 --router:external=True BAT-T0-bgw6

neutron subnet-create --name BAT-T0-bgw6-sub1 --gateway 11.127.0.9 --enable_dhcp=False BAT-T0-bgw6 11.127.0.8/29

neutron port-create BAT-T0-bgw6 --name BAT-T0-bgw6-bgw-port --device-owner baremetal:BGW-2 --binding:host_id BGW-2 --fixed-ip ip_address=11.127.0.9

neutron router-create peso-router-bgw1
neutron router-interface-add peso-router-bgw1 BAT-T0-bgw5-sub1
neutron router-interface-add peso-router-bgw1 BAT-T0-bgw6-sub1

external_gateway_info | {"network_id_2": "a36dc0e0-92af-4984-ab7d-7907032d426c", "network_id_1": "e31e4364-1885-452f-a476-4b7f19d7fe7e"} |

Now click on router properties in UI. The UI displays something went wrong
==============================================================================
============= Cause of the issue=========================================
In details method views.py in project router
if router.external_gateway_info:

            ext_net_id = router.external_gateway_info['network_id']

The external_gateway_info expects a key 'network_id'
But when more than one gateway is created, they are created with different keys('network_id_1' and 'network_id_2'), raising key error
================Possible Solution====================================
So the dictionary should be iterated to get items and the values of the keys should be retrieved

Revision history for this message
Ying Zuo (yingzuo) wrote :

I tried to do the CLI commands but got errors for these two commands:
neutron router-interface-add peso-router-bgw1 BAT-T0-bgw5-sub1
neutron router-interface-add peso-router-bgw1 BAT-T0-bgw6-sub1

I then added two interfaces to the router in Horizon and the router details panel is good.

You mentioned the external gateways of a router at the end, but that should be added with CLI command "neutron router-gateway-add" instead of "neutron router-interface-add". And there's only one gateway can be set with Horizon or CLI.

Revision history for this message
lahari (ananda-bhavaraju) wrote :

Thank you ying...we have customized OS and that's why I was able to perform these actions
I have marked the bug as invalid

Changed in horizon:
status: New → Invalid
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.