From d958b9dfadaf5d01806621cd038713a7be52e59f Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sun, 8 Dec 2019 08:15:14 +0100 Subject: [PATCH] do not init storage before first used --- tiramisu/storage/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tiramisu/storage/__init__.py b/tiramisu/storage/__init__.py index 5b9142d..3d46061 100644 --- a/tiramisu/storage/__init__.py +++ b/tiramisu/storage/__init__.py @@ -47,11 +47,13 @@ class Storage: **kwargs: Dict[str, str]) -> None: self.storage_type = None self.mod = None - self.setting(**kwargs) + if kwargs: + self.setting(**kwargs) def get(self): if self.storage_type is None: self.storage_type = environ.get('TIRAMISU_STORAGE', DEFAULT_STORAGE) + self.setting() if self.mod is None: modulepath = '{0}.storage.{1}'.format(MODULE_PATH, self.storage_type)