faucet.conf module

Base configuration implementation.

class faucet.conf.Conf(_id, dp_id, conf=None)[source]

Bases: object

Base class for FAUCET configuration.


Check config at instantiation time for errors, typically via assert.


Return text diff between two Confs.

conf_hash(dyn=False, subconf=True, ignore_keys=None)[source]

Return hash of keys configurably filtering attributes.

defaults = None
defaults_types = None
dyn_finalized = False
dyn_hash = None

Configuration parsing marked complete.

ignore_subconf(other, ignore_keys=None)[source]

Return True if this config same as other, ignoring sub config.


Merge dynamic state from other conf object.

mutable_attrs = frozenset({})
set_defaults(defaults=None, conf=None)[source]

Set default values and run any basic sanity checks.


Return configuration as a dict.


Parse supplied YAML config and sanity check.

exception faucet.conf.InvalidConfigError[source]

Bases: Exception

This error is thrown when the config file is not valid.

faucet.conf.test_config_condition(cond, msg)[source]

Evaluate condition and raise InvalidConfigError if condition True.