cobald.daemon.config.mapping module

exception cobald.daemon.config.mapping.ConfigurationError(what: Any, where: str = None)[source]

Bases: Exception

class cobald.daemon.config.mapping.M

type of a mapping element, matching JSON/YAML

alias of TypeVar(‘M’, str, int, float, bool, dict, list)

class cobald.daemon.config.mapping.SectionPlugin(section: str, digest: Callable[[M], Any], requirements: PluginRequirements)[source]

Bases: Generic[M]

Plugin to digest a top-level configuration section

  • section – Name of the section to digest

  • digest – callable that receives the section

  • requirements – plugin requirements

property after
property before
classmethod load(entry_point: EntryPoint) SectionPlugin[source]

Load a plugin from a pre-parsed entry point

Parses the following options:


If present implies required=True.


This plugin must be processed before other.


This plugin must be processed after other.

property required
class cobald.daemon.config.mapping.Translator[source]

Bases: object

Translator from a mapping to an initialised object hierarchy

construct(mapping: dict, **kwargs)[source]

Construct an object from a mapping

  • mapping – constructor definition, with __type__ and keyword arguments

  • kwargs – additional keyword arguments to pass to the constructor

static load_name(absolute_name: str)[source]

Load an object based on an absolute, dotted name

translate_hierarchy(structure: M, *, where: str = '', **construct_kwargs) M[source]
cobald.daemon.config.mapping.configure_logging(logging_mapping: dict)[source]
cobald.daemon.config.mapping.load_configuration(config_data: Dict[str, Any], plugins: Tuple[SectionPlugin] = ()) Dict[SectionPlugin, Any][source]

Load the configuration from a mapping, applying plugins to sections

  • config_data – the raw configuration without any plugins applied

  • plugins – all plugins that might apply, in order


the output of all applied plugins