Change distributed config format to make it easier for the setup tool

This commit is contained in:
Joseph Schorr 2014-08-07 13:45:15 -04:00
parent 979f78f677
commit bcbea37fce
2 changed files with 5 additions and 7 deletions

View file

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