swh.vault.cookers package

Module contents

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

  • EnvironmentError if the configuration is not for remote instance

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


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.


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

  • 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.