From ffaa4a668b447fe3f4708d99ec6fccec14f85693 Mon Sep 17 00:00:00 2001 From: Viktor Seifert Date: Fri, 30 Sep 2022 15:12:58 +0200 Subject: [PATCH] RED-5324: Added missing storage-region to key to config and to minio-client creation so that storage access works on s3 --- pyinfra/config.py | 3 +++ pyinfra/storage/adapters/s3.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyinfra/config.py b/pyinfra/config.py index 89fbce3..a08f5ab 100644 --- a/pyinfra/config.py +++ b/pyinfra/config.py @@ -49,6 +49,9 @@ class Config(object): # Password for s3 storage self.storage_secret = read_from_environment("STORAGE_SECRET", "password") + # Region for s3 storage + self.storage_region = read_from_environment("STORAGE_REGION", "eu-central-1") + # Connection string for Azure storage self.storage_azureconnectionstring = read_from_environment( "STORAGE_AZURECONNECTIONSTRING", "DefaultEndpointsProtocol=..." diff --git a/pyinfra/storage/adapters/s3.py b/pyinfra/storage/adapters/s3.py index 16e20ae..5f2f830 100644 --- a/pyinfra/storage/adapters/s3.py +++ b/pyinfra/storage/adapters/s3.py @@ -94,7 +94,7 @@ def get_s3_storage(config: Config): **_parse_endpoint(config.storage_endpoint), access_key=config.storage_key, secret_key=config.storage_secret, - # FIXME Is this still needed? Check and if yes, add it to config - # region=config.region, + # This is relevant for running on s3 + region=config.storage_region, ) )