Skip to content

Commit

Permalink
[cluster launcher] skip cleanup security groups on non-aws tests
Browse files Browse the repository at this point in the history
Signed-off-by: hongchaodeng <[email protected]>
  • Loading branch information
hongchaodeng committed Mar 18, 2024
1 parent 4e693f6 commit 6732e83
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/ray/autoscaler/launch_and_verify_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ def cleanup_security_group(ec2_client, id):


def cleanup_security_groups(config):
config.get("provider", {}).get("type")
if provider_type != "aws":
return
try:
ec2_client = boto3.client("ec2", region_name="us-west-2")
response = ec2_client.describe_security_groups(
Expand All @@ -268,7 +271,7 @@ def cleanup_security_groups(config):
)
for security_group in response["SecurityGroups"]:
cleanup_security_group(ec2_client, security_group["GroupId"])
except botocore.exceptions.ClientError as e:
except Exception as e:
print(f"Error cleaning up security groups: {e}")


Expand Down

0 comments on commit 6732e83

Please sign in to comment.