addr.list() in ip_lib.py fails when broadcast ipv4 address is not set

Bug #1090621 reported by Hisaharu Ishii
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Ante Karamatić

Bug Description

To reproduce:
  set "tenant_network_type = flat" in linuxbridge_conf.ini
  set "physical_interface_mappings = default:eth1" in linuxbridge_conf.ini
  sudo ip addr add 10.0.0.1/24 dev eth1
  run quantum router-gateway-set

then:

DEBUG:quantum.agent.linux.utils:Running command: ip addr show eth1 scope global
2012-12-14 17:20:53 DEBUG [quantum.agent.linux.utils] Running command: ip addr show eth1 scope global
DEBUG:quantum.agent.linux.utils:
Command: ['ip', 'addr', 'show', 'eth1', 'scope', 'global']
Exit code: 0
Stdout: '105: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP \n link/ether 00:21:9b:8c:e7:bd brd ff:ff:ff:ff:ff:ff\n inet 10.0.0.1/24 scope global eth1\n'
Stderr: ''
2012-12-14 17:20:53 DEBUG [quantum.agent.linux.utils]
Command: ['ip', 'addr', 'show', 'eth1', 'scope', 'global']
Exit code: 0
Stdout: '105: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP \n link/ether 00:21:9b:8c:e7:bd brd ff:ff:ff:ff:ff:ff\n inet 10.0.0.1/24 scope global eth1\n'
Stderr: ''
Traceback (most recent call last):
  File "/opt/stack/quantum/bin/quantum-linuxbridge-agent", line 24, in <module>
    main()
  File "/opt/stack/quantum/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py", line 803, in main
    plugin.daemon_loop()
  File "/opt/stack/quantum/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py", line 759, in daemon_loop
    sync = self.process_network_devices(device_info)
  File "/opt/stack/quantum/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py", line 689, in process_network_devices
    resync_a = self.treat_devices_added(device_info['added'])
  File "/opt/stack/quantum/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py", line 714, in treat_devices_added
    details['port_id'])
  File "/opt/stack/quantum/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py", line 335, in add_interface
    tap_device_name)
  File "/opt/stack/quantum/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py", line 311, in add_tap_interface
    vlan_id)
  File "/opt/stack/quantum/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py", line 288, in ensure_physical_in_bridge
    self.ensure_flat_bridge(network_id, physical_interface)
  File "/opt/stack/quantum/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py", line 185, in ensure_flat_bridge
    ips, gateway = self.get_interface_details(physical_interface)
  File "/opt/stack/quantum/quantum/plugins/linuxbridge/agent/linuxbridge_quantum_agent.py", line 176, in get_interface_details
    ips = device.addr.list(scope='global')
  File "/opt/stack/quantum/quantum/agent/linux/ip_lib.py", line 277, in list
    scope = parts[5]
IndexError: list index out of range

tags: added: l3-ipam-dhcp
tags: added: low-hanging-fruit
Changed in quantum:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/21106

Changed in quantum:
assignee: nobody → Ante Karamatić (ivoks)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/21106
Committed: http://github.com/openstack/quantum/commit/962aca526c0acdec249e84fe972f059098e1196f
Submitter: Jenkins
Branch: master

commit 962aca526c0acdec249e84fe972f059098e1196f
Author: Ante Karamatic <email address hidden>
Date: Mon Feb 4 14:02:25 2013 +0100

    Be smarter when figuring out broadcast address

    In most cases, broadcast is set when IP is set, but sometimes
    it can be ommitted. In those cases we should figure it out based
    on CIDR, and not assume it.

    Change-Id: Ia8c07898ddf0eb19f5d552a304d8f38915fc3560
    Fixes: bug #1090621

Changed in quantum:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in quantum:
milestone: none → grizzly-3
Thierry Carrez (ttx)
Changed in quantum:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in quantum:
milestone: grizzly-3 → 2013.1
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.