From 1165737fa79fce3f2ecdf868530b693d0227d657 Mon Sep 17 00:00:00 2001 From: surydurg Date: Tue, 28 Oct 2025 12:22:52 -0600 Subject: [PATCH] updating ENI description string check --- hyperpod_public_subnet/hyperpod_public_subnet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hyperpod_public_subnet/hyperpod_public_subnet.py b/hyperpod_public_subnet/hyperpod_public_subnet.py index 3064e7a..a3e06e9 100644 --- a/hyperpod_public_subnet/hyperpod_public_subnet.py +++ b/hyperpod_public_subnet/hyperpod_public_subnet.py @@ -62,8 +62,10 @@ def _describe_network_interfaces_all(ec2_client): eni_table = {} enis = _describe_network_interfaces_all(ec2_client) + # ENIs description contain the cluster ID, so check for the value + # current format is accountid_clusterid_ for eni in enis: - if eni["Description"].startswith(Config.hyperpod_cluster_arn): + if Config.cluster_id in eni["Description"]: num_secondary_addr = 0 for private_addr in eni["PrivateIpAddresses"]: @@ -85,7 +87,7 @@ def list_eips(ec2_client): if "Tags" in eip: tags = tags_as_dict(eip["Tags"]) if "HyperPodEni" in tags: - if tags["HyperPodEni"].startswith(Config.hyperpod_cluster_arn): + if Config.cluster_id in eni["Description"]: eip_table[ tags["HyperPodEni"] ] = eip return eip_table