From cd49961f3d1573c087e8b9ad4ab436f1373bb4b0 Mon Sep 17 00:00:00 2001 From: Karel van Klink <karel.vanklink@geant.org> Date: Fri, 15 Mar 2024 14:18:40 +0100 Subject: [PATCH] update IP address selection for v6 --- gso/workflows/iptrunk/create_iptrunk.py | 2 +- gso/workflows/iptrunk/migrate_iptrunk.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gso/workflows/iptrunk/create_iptrunk.py b/gso/workflows/iptrunk/create_iptrunk.py index e347d111..b54f0957 100644 --- a/gso/workflows/iptrunk/create_iptrunk.py +++ b/gso/workflows/iptrunk/create_iptrunk.py @@ -410,7 +410,7 @@ def register_dns_records(subscription: IptrunkInactive) -> State: msg = f"Missing IP resources in trunk, cannot allocate DNS record for side {fqdn}!" raise ValueError(msg) ipv4_addr = subscription.iptrunk.iptrunk_ipv4_network[index] - ipv6_addr = subscription.iptrunk.iptrunk_ipv6_network[index] + ipv6_addr = subscription.iptrunk.iptrunk_ipv6_network[index + 1] infoblox.create_host_by_ip(fqdn, ipv4_addr, ipv6_addr, "TRUNK", str(subscription.subscription_id)) diff --git a/gso/workflows/iptrunk/migrate_iptrunk.py b/gso/workflows/iptrunk/migrate_iptrunk.py index a6428491..25053570 100644 --- a/gso/workflows/iptrunk/migrate_iptrunk.py +++ b/gso/workflows/iptrunk/migrate_iptrunk.py @@ -548,7 +548,8 @@ def update_ipam(subscription: Iptrunk, replace_index: int, new_node: Router, new Move the DNS record pointing to the old side of the trunk, to the new side. """ v4_addr = subscription.iptrunk.iptrunk_ipv4_network[replace_index] - v6_addr = subscription.iptrunk.iptrunk_ipv6_network[replace_index] + # IPv6 networks start with an unused address we need to skip past. + v6_addr = subscription.iptrunk.iptrunk_ipv6_network[replace_index + 1] # Out with the old try: -- GitLab