Skip to content

Commit

Permalink
fix(hooks): fix module-config hook (#631)
Browse files Browse the repository at this point in the history
fix module-config hook

Signed-off-by: yaroslavborbat <yaroslav.752@gmail.com>
  • Loading branch information
yaroslavborbat authored Jan 15, 2025
1 parent e2ce6c4 commit b3c5083
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hooks/module_config_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ def generate_config(self) -> dict:
]
}

def check_overlaps_cidrs(networks: list[IPv4Network]) -> None:
def check_overlaps_cidrs(self, networks: list[IPv4Network]) -> None:
"""Check for overlapping CIDRs in a list of networks."""
for i, net1 in enumerate(networks):
for net2 in networks[i + 1:]:
if net1.overlaps(net2):
raise ValueError(f"Overlapping CIDRs {net1} and {net2}")

def check_node_addresses_overlap(networks: list[IPv4Network], node_addresses: list[IPv4Address]) -> None:
def check_node_addresses_overlap(self, networks: list[IPv4Network], node_addresses: list[IPv4Address]) -> None:
"""Check if node addresses overlap with any subnet."""
for addr in node_addresses:
for net in networks:
Expand Down

0 comments on commit b3c5083

Please sign in to comment.