"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zaqar/storage/utils.py" between
zaqar-9.0.0.tar.gz and zaqar-10.0.0.tar.gz

About: OpenStack Zaqar is a multi-tenant cloud messaging and notification service for web and mobile developers.
The "Ussuri" series (latest release).

utils.py  (zaqar-9.0.0):utils.py  (zaqar-10.0.0)
skipping to change at line 96 skipping to change at line 96
driver_type = 'zaqar.{0}.storage'.format(mode) driver_type = 'zaqar.{0}.storage'.format(mode)
storage_type = six.moves.urllib_parse.urlparse(uri).scheme or default_store storage_type = six.moves.urllib_parse.urlparse(uri).scheme or default_store
try: try:
mgr = driver.DriverManager(driver_type, storage_type, mgr = driver.DriverManager(driver_type, storage_type,
invoke_on_load=False) invoke_on_load=False)
return mgr.driver return mgr.driver
except Exception as exc: except Exception as exc:
LOG.exception(exc) LOG.exception('Error loading storage driver')
raise errors.InvalidDriver(exc) raise errors.InvalidDriver(exc)
def load_storage_driver(conf, cache, storage_type=None, def load_storage_driver(conf, cache, storage_type=None,
control_mode=False, control_driver=None): control_mode=False, control_driver=None):
"""Loads a storage driver and returns it. """Loads a storage driver and returns it.
The driver's initializer will be passed conf and cache as The driver's initializer will be passed conf and cache as
its positional args. its positional args.
:param conf: Configuration instance to use for loading the :param conf: Configuration instance to use for loading the
skipping to change at line 148 skipping to change at line 148
if conf.profiler.enabled: if conf.profiler.enabled:
if ((mode == "control" and conf.profiler.trace_management_store) or if ((mode == "control" and conf.profiler.trace_management_store) or
(mode == "data" and conf.profiler.trace_message_store)): (mode == "data" and conf.profiler.trace_message_store)):
trace_name = '{0}_{1}_driver'.format(storage_type, mode) trace_name = '{0}_{1}_driver'.format(storage_type, mode)
return profiler.trace_cls(trace_name, return profiler.trace_cls(trace_name,
trace_private=True)(mgr.driver) trace_private=True)(mgr.driver)
else: else:
return mgr.driver return mgr.driver
except Exception as exc: except Exception as exc:
LOG.error('Failed to load "{}" driver for "{}"'.format( LOG.exception('Failed to load "%s" driver for "%s"',
driver_type, storage_type)) driver_type, storage_type)
LOG.exception(exc)
raise errors.InvalidDriver(exc) raise errors.InvalidDriver(exc)
def keyify(key, iterable): def keyify(key, iterable):
"""Make an iterator from an iterable of dicts compared with a key. """Make an iterator from an iterable of dicts compared with a key.
:param key: A key exists for all dict inside the iterable object :param key: A key exists for all dict inside the iterable object
:param iterable: The input iterable object :param iterable: The input iterable object
""" """
class Keyed(object): class Keyed(object):
 End of changes. 2 change blocks. 
4 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)