]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Prevent stale DHCP directories for dhcp agent nodes
authorarmando-migliaccio <amigliaccio@nicira.com>
Wed, 11 Sep 2013 18:49:48 +0000 (11:49 -0700)
committerarmando-migliaccio <amigliaccio@nicira.com>
Fri, 13 Sep 2013 18:34:20 +0000 (11:34 -0700)
commiteea6218e425766cefc62757da85b9de058d8e312
tree24615cea320022a88f6038d19fb15d8e0ba8df43
parent494c97a413371b443c8e8d38abfb4dfd02090e86
Prevent stale DHCP directories for dhcp agent nodes

This change fixes an issue that is most acute in test/dev
environments but that may affect production environments
as well: the presence of DHCP directories that no longer
represent networks that exist in the Neutron DB. This
issue can manifest itself over time if you delete networks
from the Server while the Agent node is down.

Without this fix, at the agent start-up the method
existing_dhcp_networks will return an empty list, and
as a consequence the directories that belong to networks
that have been removed from the server will stay because
the sync logic will not process them as it only looks at
the mismatch between active networks on the agent and
active networks on the server. With the fix instead, we
return *all* existing dhcp networks; if they are meant to
be active, the agent will bring them up, if they no longer
exist on the server, then the agent will dispose of the
resources. The dnsmasq driver will do the right thing when
enabling or disabling the process.

Fixes bug #1195770

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