From 9d3d87d9d53f36dd177e64aeaeb973d47310a55e Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Tue, 16 Apr 2019 18:21:42 +0200 Subject: [PATCH] Make config check skippable for tests --- restic_volume_backup/config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/restic_volume_backup/config.py b/restic_volume_backup/config.py index 8ef4214..10ee3d2 100644 --- a/restic_volume_backup/config.py +++ b/restic_volume_backup/config.py @@ -2,11 +2,13 @@ import os class Config: - def __init__(self): + def __init__(self, check=True): self.repository = os.environ['RESTIC_REPOSITORY'] self.password = os.environ['RESTIC_PASSWORD'] self.docker_base_url = os.environ.get('DOCKER_BASE_URL') or "unix://tmp/docker.sock" - self.check() + + if check: + self.check() def check(self): if not self.repository: