swh.storage package

Module contents

exception swh.storage.HashCollision[source]

Bases: Exception

__module__ = 'swh.storage'
__weakref__

list of weak references to the object (if defined)

swh.storage.get_storage(cls, **kwargs)[source]

Get a storage object of class storage_class with arguments storage_args.

Parameters
  • storage (dict) – dictionary with keys:

  • cls (-) – storage’s class, either local, remote, memory, filter, buffer

  • args (-) – dictionary with keys

Returns

an instance of swh.storage.Storage or compatible class

Raises

ValueError if passed an unknown storage class.

swh.storage.get_storage_pipeline(steps)[source]

Recursively get a storage object that may use other storage objects as backends.

Parameters

steps (List[dict]) – List of dicts that may be used as kwargs for get_storage.

Returns

an instance of swh.storage.Storage or compatible class

Raises

ValueError if passed an unknown storage class.