Change distributed config format to make it easier for the setup tool
This commit is contained in:
parent
979f78f677
commit
bcbea37fce
2 changed files with 5 additions and 7 deletions
|
@ -13,17 +13,15 @@ class Storage(object):
|
|||
self.state = None
|
||||
|
||||
def init_app(self, app):
|
||||
# storage_type = app.config.get('STORAGE_TYPE', 'LocalStorage')
|
||||
# path = app.config.get('STORAGE_PATH', '')
|
||||
|
||||
storages = {}
|
||||
for location, storage_params in app.config.get('DISTRIBUTED_STORAGE_CONFIG').items():
|
||||
driver = storage_params[0]
|
||||
parameters = storage_params[1]
|
||||
|
||||
if driver == 'LocalStorage':
|
||||
storage = LocalStorage(*storage_params[1:])
|
||||
storage = LocalStorage(**parameters)
|
||||
elif driver == 'S3Storage':
|
||||
storage = S3Storage(*storage_params[1:])
|
||||
storage = S3Storage(**parameters)
|
||||
else:
|
||||
storage = FakeStorage()
|
||||
|
||||
|
|
Reference in a new issue