Skip to content

Commit

Permalink
Add support of open stack bucket provider (#2371)
Browse files Browse the repository at this point in the history
* Add support of open stack bucket provider

* Add changelog
  • Loading branch information
romasku authored Oct 25, 2021
1 parent 9ab9ee7 commit fa755c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.D/2371.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support of open stack as bucket provider.
7 changes: 6 additions & 1 deletion neuro-sdk/src/neuro_sdk/buckets.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,7 @@ class Provider(str, enum.Enum):
MINIO = "minio"
AZURE = "azure"
GCP = "gcp"
OPEN_STACK = "open_stack"


@dataclass(frozen=True)
Expand Down Expand Up @@ -1198,7 +1199,11 @@ async def _get_new_credentials() -> BucketCredentials:
return await self.request_tmp_credentials(bucket.id, cluster_name)

provider: BucketProvider
if bucket.provider in (Bucket.Provider.AWS, Bucket.Provider.MINIO):
if bucket.provider in (
Bucket.Provider.AWS,
Bucket.Provider.MINIO,
Bucket.Provider.OPEN_STACK,
):
async with S3Provider.create(bucket, _get_new_credentials) as provider:
yield provider
elif bucket.provider == Bucket.Provider.AZURE:
Expand Down

0 comments on commit fa755c6

Please sign in to comment.