Skip to content

Commit

Permalink
Fix subnet prefix usage
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicaj committed Sep 3, 2024
1 parent 17b939c commit 2434e80
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ def validate_address_pools(system_ips: list[dict], user_specified_networks: list
seen_networks = set()
for index, user_network in enumerate(user_specified_networks):
base_network = ipaddress.ip_network(user_network['base'], False)
subnet_prefix = int(user_network['base'].split('/')[-1])

# Validate subnet size vs. base network
if subnet_prefix > user_network['size']:
if base_network.prefixlen > user_network['size']:
verrors.add(
f'docker_update.address_pools.{index}.base',
f'Base network {user_network["base"]} cannot be smaller than '
Expand Down

0 comments on commit 2434e80

Please sign in to comment.