Skip to content

Commit

Permalink
Fix subnet prefix usage
Browse files Browse the repository at this point in the history
(cherry picked from commit 2434e80)
  • Loading branch information
sonicaj authored and bugclerk committed Sep 3, 2024
1 parent 0ebecae commit 8ad719a
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 8ad719a

Please sign in to comment.