diff --git a/sdcm/cluster.py b/sdcm/cluster.py index 6540fbc6cc..8f4b7f5a4b 100644 --- a/sdcm/cluster.py +++ b/sdcm/cluster.py @@ -2742,7 +2742,8 @@ def get_peers_info(self): for row in cql_results: peer = row.peer try: - ipaddress.ip_address(row.peer) + # make sure we use ipv6 long format (some tools remove leading zeros) + peer = ipaddress.ip_address(row.peer).exploded except ValueError as exc: current_err = f"Peer '{peer}' is not an IP address, err: {exc}\n" LOGGER.warning(current_err) @@ -2774,7 +2775,8 @@ def get_gossip_info(self) -> dict[BaseNode, dict]: if line.startswith('SCHEMA:'): schema = line.replace('SCHEMA:', '') elif line.startswith('RPC_ADDRESS:'): - ip = line.replace('RPC_ADDRESS:', '') + # make sure we use ipv6 long format (some tools remove leading zeros) + ip = ipaddress.ip_address(line.replace('RPC_ADDRESS:', '')).exploded elif line.startswith('STATUS:'): status = line.replace('STATUS:', '').split(',')[0] elif line.startswith('DC:'): diff --git a/sdcm/cluster_aws.py b/sdcm/cluster_aws.py index 63d21a5c2e..3bd04df74d 100644 --- a/sdcm/cluster_aws.py +++ b/sdcm/cluster_aws.py @@ -12,7 +12,7 @@ # Copyright (c) 2020 ScyllaDB # pylint: disable=too-many-lines, too-many-public-methods - +import ipaddress import json import logging import os @@ -460,7 +460,9 @@ def network_interfaces(self): for interface in self._instance.network_interfaces: private_ip_addresses = [private_address["PrivateIpAddress"] for private_address in interface.private_ip_addresses] - ipv6_addresses = [ipv6_address['Ipv6Address'] for ipv6_address in interface.ipv6_addresses] + # make sure we use ipv6 long format (some tools remove leading zeros) + ipv6_addresses = [ipaddress.ip_address( + ipv6_address['Ipv6Address']).exploded for ipv6_address in interface.ipv6_addresses] device_indexes.append(interface.attachment['DeviceIndex']) ipv4_public_address = interface.association_attribute['PublicIp'] if interface.association_attribute else None dns_public_name = interface.association_attribute['PublicDnsName'] if interface.association_attribute else None