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()[source]

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

conf_diff(other)[source]

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
finalize()[source]

Configuration parsing marked complete.

ignore_subconf(other, ignore_keys=None)[source]

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

merge_dyn(other_conf)[source]

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.

to_conf()[source]

Return configuration as a dict.

update(conf)[source]

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 not True.