From 34bfc0d3d9ce342e76b39b8713f71350a845aadf Mon Sep 17 00:00:00 2001 From: Paige Patton <64206430+paigerube14@users.noreply.github.com> Date: Wed, 18 Sep 2024 13:55:58 -0400 Subject: [PATCH] Adding aws bare metal (#695) * adding aws bare metal rh-pre-commit.version: 2.2.0 rh-pre-commit.check-secrets: ENABLED * no found reservations rh-pre-commit.version: 2.2.0 rh-pre-commit.check-secrets: ENABLED --------- Co-authored-by: Auto User --- kraken/node_actions/aws_node_scenarios.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kraken/node_actions/aws_node_scenarios.py b/kraken/node_actions/aws_node_scenarios.py index 0107065b..6894e620 100644 --- a/kraken/node_actions/aws_node_scenarios.py +++ b/kraken/node_actions/aws_node_scenarios.py @@ -13,7 +13,11 @@ def __init__(self): # Get the instance ID of the node def get_instance_id(self, node): - return self.boto_client.describe_instances(Filters=[{"Name": "private-dns-name", "Values": [node]}])[ + instance = self.boto_client.describe_instances(Filters=[{"Name": "private-dns-name", "Values": [node]}]) + if len(instance['Reservations']) == 0: + node = node[3:].replace('-','.') + instance = self.boto_client.describe_instances(Filters=[{"Name": "private-ip-address", "Values": [node]}]) + return instance[ "Reservations" ][0]["Instances"][0]["InstanceId"]