From cb230e9873fa8fe1b292ea812b44b86944b72c86 Mon Sep 17 00:00:00 2001 From: Radovan Zvoncek Date: Thu, 7 Dec 2023 16:33:57 +0200 Subject: [PATCH] [S3 storage] Fix parent creation bug when downloading --- medusa/storage/s3_base_storage.py | 5 +++-- tests/integration/features/integration_tests.feature | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/medusa/storage/s3_base_storage.py b/medusa/storage/s3_base_storage.py index 5fe25db7..4ee96de2 100644 --- a/medusa/storage/s3_base_storage.py +++ b/medusa/storage/s3_base_storage.py @@ -288,12 +288,13 @@ def __download_blob(self, src: str, dest: str): # print also object size logging.debug( - '[S3 Storage] Downloading {} -> {}/{}'.format( - object_key, self.bucket_name, object_key + '[S3 Storage] Downloading s3://{}/{} -> {}'.format( + self.bucket_name, object_key, file_path ) ) try: + Path(file_path).parent.mkdir(parents=True, exist_ok=True) self.s3_client.download_file( Bucket=self.bucket_name, Key=object_key, diff --git a/tests/integration/features/integration_tests.feature b/tests/integration/features/integration_tests.feature index d5d0f76e..9c8bb615 100644 --- a/tests/integration/features/integration_tests.feature +++ b/tests/integration/features/integration_tests.feature @@ -1078,3 +1078,8 @@ Feature: Integration tests Examples: Local storage | storage | client encryption | | local | without_client_encryption | + + @s3 + Examples: S3 storage + | storage | client encryption | + | s3_us_west_oregon | without_client_encryption |