NSX|P: Update ports dhcp bindings when enabling subnet dhcp

Change-Id: I07fa28d6c6f9d9ce86084dfb933a913a2fa097b3
This commit is contained in:
asarfaty 2021-01-14 15:09:05 +02:00 committed by Adit Sarfaty
parent b4c3b48d17
commit f500e331b7
2 changed files with 4 additions and 4 deletions

View File

@ -1582,9 +1582,9 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
context, subnet_data, updated_subnet)
# Check if needs to update DHCP related NSX resources
# (only if the subnet changed, but dhcp was already enabled)
if (enable_dhcp and orig_enable_dhcp and
('dns_nameservers' in subnet_data or
if (enable_dhcp and
(not orig_enable_dhcp or
'dns_nameservers' in subnet_data or
'gateway_ip' in subnet_data or
'host_routes' in subnet_data)):
self._update_nsx_net_dhcp(context, network, net_az, updated_subnet)

View File

@ -1257,7 +1257,7 @@ class NsxPTestSubnets(common_v3.NsxV3TestSubnets,
self._verify_dhcp_service(subnet['subnet']['network_id'],
subnet['subnet']['tenant_id'], True)
# verify backend calls
seg_update.assert_called_once_with(
seg_update.assert_called_with(
dhcp_server_config_id=NSX_DHCP_PROFILE_ID,
segment_id=subnet['subnet']['network_id'],
subnets=[mock.ANY])