Skip to content

Commit 8a41dcd

Browse files
Williangalvanipatrickelectric
authored andcommitted
cable-guy: only skipping adding dhcp server if the ip is on the interface, too
1 parent bb3d81c commit 8a41dcd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/services/cable_guy/api/manager.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,11 @@ def add_dhcp_server_to_interface(self, interface_name: str, ipv4_gateway: str, b
629629
"""
630630
if self._is_dhcp_server_running_on_interface(interface_name):
631631
dhcp_on_interface = self._dhcp_server_on_interface(interface_name)
632-
if dhcp_on_interface.ipv4_gateway == ipv4_gateway and dhcp_on_interface.is_backup_server == backup:
632+
if (
633+
dhcp_on_interface.ipv4_gateway == ipv4_gateway
634+
and dhcp_on_interface.is_backup_server == backup
635+
and self._is_ip_on_interface(interface_name, ipv4_gateway)
636+
):
633637
logger.warning(
634638
f"DHCP server with gateway '{ipv4_gateway}' and backup '{backup}' already exists on interface '{interface_name}'"
635639
)

0 commit comments

Comments
 (0)