It was observed in http://d-jenkins.ubuntu-ci:8080/view/MAAS/job/utopic-adt-maas/45/artifact/results/artifacts/maas-logs/var/log/maas/celery.log/*view*/ that MAAS triggers 5 write_dhcp_config tasks when only one nodegroup change was requested through the MAAS CLI (see the tests run by that jenkins job lines 407 to 444: http://bazaar.launchpad.net/~maas-maintainers/maas/qa-lab-tests/view/head:/maas-integration.py)
This coupled to the fact that celery is not executing the tasks FIFO (see bug 1324943) seem to have a caused a race condition where the dhcp config done through the CLI is overwritten by a previous tasks.
* Remove possible race condition that might cause changes to dhcpd.conf to be lost when stopping dhcpd
* Install maas and run included test test_stop_dhcp_server_sends_command_and_writes_empty_config and test_set_up_dhcp_region from integration tests and check celery.log has only one write_dhcp_config task triggered
* Minimal -- simply write blank config instead of invalid configs and only once