do not init storage before first used

This commit is contained in:
Emmanuel Garette 2019-12-08 08:15:14 +01:00
parent d9c0b18404
commit d958b9dfad

View file

@ -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)