swh.vault.cookers package

Module contents

swh.vault.cookers.get_cooker_cls(obj_type)[source]
swh.vault.cookers.check_config(cfg: Dict[str, Any]) → Dict[str, Any][source]

Ensure the configuration is ok to run a vault worker, and propagate defaults

Raises
  • EnvironmentError if the configuration is not for remote instance

  • ValueError if one of the following keys is missing – vault, storage

Returns

New configuration dict to instantiate a vault worker instance

swh.vault.cookers.get_cooker(obj_type: str, obj_id: str)[source]

Instantiate a cooker class of type obj_type.

Returns

Cooker class in charge of cooking the obj_type with id obj_id.

Raises
  • ValueError in case of a missing top-level vault key configuration or a storage – key.

  • EnvironmentError in case the vault configuration reference a non remote class.