866e1819bf
Currently when users delete a network with a DHCP-enabled subnet and without any VM instances in the network, the operation will fail due to DHCP port not found. The reason is when neutron's delete_network is called, it removes ports with DEVICE_OWNER_DHCP in the session. Thus later the plugin can not find the DHCP port when detaching the associated DHCP server for the network. This patch fixes the problem by detaching the DHCP server in the plugin's delete_network before calling neutron's delete_network. It also makes sure DHCP service exists before processing it. Change-Id: Ifd55f19ae9f7a44e5f38cfe9060523b39f0b6b0f