faucet.conf module

Base configuration implementation.

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

Bases: object

Base class for FAUCET configuration.

static check_config()[source]

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


Return text diff between two Confs.

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

Return hash of keys configurably filtering attributes.

defaults = {}
defaults_types = {}
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 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.

  • cond (bool) – Condition on which to raise an error if it is true

  • msg (str) – Message for the error if the condition is true