mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 13:29:47 +00:00
add auto_create_bucket defaulting to false, enabled for tests
This commit is contained in:
parent
d67d679baf
commit
72036891e8
5 changed files with 47 additions and 0 deletions
|
|
@ -59,6 +59,11 @@ async def _create_bucket_if_not_exists(client: boto3.client, config: S3FilesImpl
|
|||
except ClientError as e:
|
||||
error_code = e.response["Error"]["Code"]
|
||||
if error_code == "404":
|
||||
if not config.auto_create_bucket:
|
||||
raise RuntimeError(
|
||||
f"S3 bucket '{config.bucket_name}' does not exist. "
|
||||
f"Either create the bucket manually or set 'auto_create_bucket: true' in your configuration."
|
||||
) from e
|
||||
try:
|
||||
# For us-east-1, we can't specify LocationConstraint
|
||||
if config.region == "us-east-1":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue