Fix storage indentation

This commit is contained in:
Joseph Schorr 2017-10-17 14:12:14 -04:00
parent dcec90649e
commit 5dfa46ed56
2 changed files with 12 additions and 8 deletions

View file

@ -15,13 +15,15 @@ STORAGE_DRIVER_CLASSES = {
}
def get_storage_driver(location, metric_queue, chunk_cleanup_queue, config_provider, ip_resolver, storage_params):
def get_storage_driver(location, metric_queue, chunk_cleanup_queue, config_provider, ip_resolver,
storage_params):
""" Returns a storage driver class for the given storage configuration
(a pair of string name and a dict of parameters). """
driver = storage_params[0]
parameters = storage_params[1]
driver_class = STORAGE_DRIVER_CLASSES.get(driver, FakeStorage)
context = StorageContext(location, metric_queue, chunk_cleanup_queue, config_provider, ip_resolver)
context = StorageContext(location, metric_queue, chunk_cleanup_queue, config_provider,
ip_resolver)
return driver_class(context, **parameters)
@ -44,7 +46,8 @@ class Storage(object):
else:
self.state = None
def init_app(self, app, metric_queue, chunk_cleanup_queue, instance_keys, config_provider, ip_resolver):
def init_app(self, app, metric_queue, chunk_cleanup_queue, instance_keys, config_provider,
ip_resolver):
storages = {}
for location, storage_params in app.config.get('DISTRIBUTED_STORAGE_CONFIG').items():
storages[location] = get_storage_driver(location, metric_queue, chunk_cleanup_queue,