mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-02-23 15:14:44 +01:00
fix(autogpt): Fix GCS and S3 root path issue (#7010)
Fix root path issue
This commit is contained in:
committed by
GitHub
parent
37904a0f80
commit
cb1297ec74
@@ -33,7 +33,9 @@ class GCSFileStorage(FileStorage):
|
||||
def __init__(self, config: GCSFileStorageConfiguration):
|
||||
self._bucket_name = config.bucket
|
||||
self._root = config.root
|
||||
assert self._root.is_absolute()
|
||||
# Add / at the beginning of the root path
|
||||
if not self._root.is_absolute():
|
||||
self._root = Path("/").joinpath(self._root)
|
||||
|
||||
self._gcs = storage.Client()
|
||||
super().__init__()
|
||||
|
||||
@@ -42,7 +42,9 @@ class S3FileStorage(FileStorage):
|
||||
def __init__(self, config: S3FileStorageConfiguration):
|
||||
self._bucket_name = config.bucket
|
||||
self._root = config.root
|
||||
assert self._root.is_absolute()
|
||||
# Add / at the beginning of the root path
|
||||
if not self._root.is_absolute():
|
||||
self._root = Path("/").joinpath(self._root)
|
||||
|
||||
# https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html
|
||||
self._s3 = boto3.resource(
|
||||
|
||||
Reference in New Issue
Block a user