]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Only setup dhcp interface if dhcp is not active on network
authorOleg Bondarev <obondarev@mirantis.com>
Thu, 18 Sep 2014 14:39:43 +0000 (18:39 +0400)
committerOleg Bondarev <obondarev@mirantis.com>
Thu, 18 Sep 2014 14:53:58 +0000 (18:53 +0400)
commitd144cb8ff422e16c5917c87471a46fd095fd1856
treec4a29d3a21c2a0fd048bd2e1608293fae5150326
parente31861c15bc73e65a7c22212df2a56f9e45aa0e4
Only setup dhcp interface if dhcp is not active on network

When enabling (DhcpLocalProcess.enable()) dhcp for a network the agent
first sets dhcp interface, then checks if dhcp is curently active and
if it's true then the agent restarts dhcp.
Restart (DhcpBase.restart()) first disables dhcp and then enables it again
by calling DhcpLocalProcess.enable() recursively which in turn sets
dhcp interface again (it doesn't see the port created earlier as network
is not re-fetched from db). This leads to duplicate dhcp interface
for the network.

The fix is to only setup dhcp interface if dhcp is not active.

Closes-Bug: #1339968

Change-Id: I3a6d2fd5b18a97138ac5b699ecd4d4b30dbdbacb
neutron/agent/linux/dhcp.py
neutron/tests/unit/test_linux_dhcp.py