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]
-
Plugin to digest a top-level configuration section
- Parameters:
section – Name of the section to digest
digest – callable that receives the section
requirements – plugin requirements
- property after
- property before
- digest
- classmethod load(entry_point: EntryPoint) SectionPlugin [source]
Load a plugin from a pre-parsed entry point
Parses the following options:
required
If present implies
required=True
.before=other
This plugin must be processed before
other
.after=other
This plugin must be processed after
other
.
- property required
- requirements
- section
- class cobald.daemon.config.mapping.Translator[source]
Bases:
object
Translator from a mapping to an initialised object hierarchy
- 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
- Parameters:
config_data – the raw configuration without any plugins applied
plugins – all plugins that might apply, in order
- Returns:
the output of all applied plugins