libranet_logging.yaml

libranet_logging.yaml.

In pyyaml 5.1 some incompatibilies were introduced with regard to yaml.load to make it more safe by default.

please see:

Functions

constructor_env(loader, node)

YAML-Constructor to load a value from a env-variable.

add_constructor()

Register the !env-constructor with pyyaml.

read_yaml(yaml_path[, variables])

Read the yaml-file.

Module Contents

libranet_logging.yaml.constructor_env(loader, node)

YAML-Constructor to load a value from a env-variable.

Usage in yml:

> !env ENVVAR_NAME, DEFAULTVALUE_IF_ENVVAR_NOT_SET

Parameters:
  • loader (Any)

  • node (Any)

Return type:

Union[str, List[str]]

libranet_logging.yaml.add_constructor()

Register the !env-constructor with pyyaml.

Return type:

None

libranet_logging.yaml.read_yaml(yaml_path, variables=None)

Read the yaml-file.

Returns: dict

Parameters:
  • yaml_path (str)

  • variables (Dict[str, str] | None)

Return type:

Dict