Skip to content

Commit 77d3d0f

Browse files
committed
Removed s3_client.exceptions from except if tag is missing to only catch botocore error
1 parent 0c92aee commit 77d3d0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/util/k8s/terminate_cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ def delete_expired_tf_state_s3_buckets():
983983
created_date = bucket["CreationDate"]
984984
try:
985985
tags = s3_client.get_bucket_tagging(Bucket=bucket["Name"])["TagSet"]
986-
except (s3_client.exceptions.NoSuchTagSet, botocore.exceptions.ClientError):
986+
except botocore.exceptions.ClientError:
987987
raise RuntimeError(f"S3 bucket {bucket['Name']} does not have any tags.")
988988
persist_days = next((tag["Value"] for tag in tags if tag["Key"] == "persist_days"), None)
989989
if persist_days:

0 commit comments

Comments
 (0)