Skip to content

Commit

Permalink
catch s3 redirect for put_object
Browse files Browse the repository at this point in the history
  • Loading branch information
jreadey committed May 25, 2024
1 parent 4aea69f commit 203b734
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hsds/util/s3Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ async def put_object(self, key, data, bucket=None):
}
except ClientError as ce:
response_code = ce.response["Error"]["Code"]
if response_code == "NoSuchBucket":
if response_code in ("NoSuchBucket", "PermanentRedirect"):
msg = f"s3_bucket: {bucket} not found"
log.warn(msg)
raise HTTPNotFound()
Expand Down

0 comments on commit 203b734

Please sign in to comment.