From bb5b73e189b161d8194bdd424e17fb3c187f52b2 Mon Sep 17 00:00:00 2001 From: Francisco Schulz Date: Thu, 13 Oct 2022 10:29:57 +0200 Subject: [PATCH] load different env vars for the variable depending on the set --- pyinfra/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyinfra/config.py b/pyinfra/config.py index a08f5ab..3ebcd4f 100644 --- a/pyinfra/config.py +++ b/pyinfra/config.py @@ -38,7 +38,10 @@ class Config(object): self.storage_backend = read_from_environment("STORAGE_BACKEND", "s3") # The bucket / container to pull files specified in queue requests from - self.storage_bucket = read_from_environment("STORAGE_BUCKET_NAME", "redaction") + if self.storage_backend == "s3": + self.storage_bucket = read_from_environment("STORAGE_BUCKET_NAME", "redaction") + else: + self.storage_bucket = read_from_environment("STORAGE_AZURECONTAINERNAME", "redaction") # Endpoint for s3 storage self.storage_endpoint = read_from_environment("STORAGE_ENDPOINT", "http://127.0.0.1:9000")