Skip to content

Commit

Permalink
Adding aws bare metal (krkn-chaos#695)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
paigerube14 and Auto User authored Sep 18, 2024
1 parent 736c90e commit 34bfc0d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kraken/node_actions/aws_node_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down

0 comments on commit 34bfc0d

Please sign in to comment.