faucet.valves_manager module

Manage a collection of Valves.

class faucet.valves_manager.ConfigWatcher[source]

Bases: object

Watch config for file or content changes.

config_file = None
config_file_stats = None
config_hashes = None

Return True if config file content actually changed.


Return True if any config files changed.

update(new_config_file, new_config_hashes=None)[source]

Update state with new config file/hashes.

class faucet.valves_manager.MetaDPState[source]

Bases: object

Contains state/config about all DPs.

class faucet.valves_manager.ValvesManager(logname, logger, metrics, notifier, bgp, dot1x, config_auto_revert, send_flows_to_dp_by_id)[source]

Bases: object

Manage a collection of Valves.

datapath_connect(now, valve, discovered_up_ports)[source]

Handle connection from DP.


raises event for event sock heartbeat

healthy_stack_roots(now, candidate_dps)[source]

Return list of healthy stack root names.

load_configs(now, new_config_file, delete_dp=None)[source]

Load/apply new config to all Valves.


Maintain current stack root and return True if stack root changes.


Return parsed configs for Valves, or None.

port_status_handler(valve, msg, now)[source]

Handle a port status change message.

request_reload_configs(now, new_config_file, delete_dp=None)[source]

Process a request to load config changes.


Attempt to revert config to last known good version.

update_config_applied(sent=None, reset=False)[source]

Update faucet_config_applied from {dpid: sent} dict, defining applied == sent == enqueued via Ryu


Update metrics in all Valves.

valve_flow_services(now, valve_service)[source]

Call a method on all Valves and send any resulting flows.

valve_packet_in(now, valve, msg)[source]

Time a call to Valve packet in handler.

valves = None