faucet.config_parser_util module

Utility functions supporting FAUCET/Gauge config parsing.

class faucet.config_parser_util.UniqueKeyLoader(stream)[source]

Bases: yaml.loader.Loader

YAML loader that will reject duplicate/overwriting keys.

construct_mapping(node, deep=False)[source]

Check for duplicate YAML keys.

faucet.config_parser_util.config_changed(top_config_file, new_top_config_file, config_hashes)[source]

Return True if configuration has changed.

  • top_config_file (str) – name of FAUCET config file

  • new_top_config_file (str) – name, possibly new, of FAUCET config file.

  • config_hashes (dict) – map of config file/includes and hashes of contents.


True if the file, or any file it includes, has changed.

Return type



Return hash of YAML config file contents.


Return hash of config file content.

faucet.config_parser_util.dp_config_path(config_file, parent_file=None)[source]

Return full path to config file.

faucet.config_parser_util.dp_include(config_hashes, config_contents, config_file, logname, top_confs)[source]

Handles including additional config files


Return logger instance for config parsing.

faucet.config_parser_util.read_config(config_file, logname)[source]

Return a parsed YAML config file or None.