]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
read_hosts_file_leases shouldn't parse stateless IPv6
authorvenkata anil <anil.venkata@enovance.com>
Thu, 18 Jun 2015 10:03:12 +0000 (10:03 +0000)
committervenkata anil <anil.venkata@enovance.com>
Thu, 18 Jun 2015 10:03:44 +0000 (10:03 +0000)
commitcdde9a3aeb929e80aa3c251a44060b8174ab7b6c
treef486d778a5bec25b008f1ff3f2ab51a674568f45
parent5c588003e2a84234229145b74f1f9db04abc1280
read_hosts_file_leases shouldn't parse stateless IPv6

Error when _read_hosts_file_leases tries to parse stateless IPv6 entry
in hosts file
TRACE neutron.agent.dhcp.agent ip = host[2].strip('[]')
TRACE neutron.agent.dhcp.agent IndexError: list index out of range

Neutron creates entries in dhcp host file for each subnet of a port.
Each of these entries will have same mac address as first field,
and may have client_id, fqdn, ipv4/ipv6 address for dhcp/dhcpv6 stateful,
or tag as other fields.

For dhcpv6 stateless subnet with extra_dhcp_opts,
host file will have only mac address and tag. So _read_hosts_file_leases
shouldn't check for ip address for this entry in host file.

Closes-bug: #1465330
Change-Id: Iad6605ac5c7bcd6ec9204352037ed021f5007738
neutron/agent/linux/dhcp.py
neutron/tests/unit/agent/linux/test_dhcp.py