Skip to content

Commit

Permalink
Merge pull request #126 from rundeck-plugins/fix_region
Browse files Browse the repository at this point in the history
Fix region attribute
  • Loading branch information
chrismcg14 authored Feb 1, 2023
2 parents 8fe3fb8 + 62c98b0 commit 231e2ed
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,20 @@ public NodeSetImpl performQuery() {
}
else if(region != null){
ec2.setEndpoint("https://ec2." + region + ".amazonaws.com");
zones = ec2.describeAvailabilityZones();
final ArrayList<Filter> filters = buildFilters();

final Set<Instance> newInstances = addExtraMappingAttribute(query(ec2, new DescribeInstancesRequest().withFilters(filters).withMaxResults(maxResults)));

if (newInstances != null && !newInstances.isEmpty()) {
instances.addAll(newInstances);
}

try {
Thread.sleep(100);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
}
else{
zones = ec2.describeAvailabilityZones();
Expand Down

0 comments on commit 231e2ed

Please sign in to comment.