faucet.stack module¶
Configuration for a stack.
-
class
faucet.stack.
Stack
(_id, dp_id, name, canonical_port_order, conf)[source]¶ Bases:
faucet.conf.Conf
Stores state related to DP stack information, this includes the current elected root as that is technically a fixed allocation for this DP Stack instance.
-
defaults
= {'down_time_multiple': 3, 'priority': None, 'route_learning': False}¶
-
defaults_types
= {'down_time_multiple': <class 'int'>, 'priority': <class 'int'>, 'route_learning': <class 'bool'>}¶
-
health_timeout
(now, update_time)[source]¶ Return stack node’s health_timeout, the time before a timeout is recognized
-
is_in_path
(src_dp, dst_dp)[source]¶ Return True if the current DP is in the path from src_dp to dst_dp
- Parameters
src_dp (str) – DP name
dst_dp (str) – DP name
- Returns
True if self is in the path from the src_dp to the dst_dp.
- Return type
bool
-
static
modify_topology
(graph, dp, port, add=True)[source]¶ Add/remove an edge to the stack graph which originates from this dp and port.
-
peer_symmetric_up_ports
(peer_dp)[source]¶ Return list of stack ports that are up towards us from a peer
-
resolve_topology
(dps, meta_dp_state)[source]¶ Resolve & verify correct inter-DP stacking config
- Parameters
dps (list) – List of configured DPs
meta_dp_state (MetaDPState) – Provided if reloading when choosing a new root DP
-
shortest_path_port
(dest_dp)[source]¶ Return first port on our DP, that is the shortest path towards dest DP.
-
shortest_symmetric_path_port
(peer_dp)[source]¶ Return port on our DP that is the first port of the adjacent DP towards us
-
update_health
(now, dp_last_live_time, update_time, down_lacp_ports, down_stack_ports)[source]¶ Determines whether the current stack node is healthy
- Parameters
now (float) –
dp_last_live_time (dict) – Last live time value for each DP
update_time (int) – Stack root update interval time
down_lacp_ports (tuple) – Tuple of LACP ports that are not UP
down_stack_ports (tuple) – Tuple of stack ports that are not UP
- Returns
Current stack node health state, str: Reason for the current state
- Return type
bool
-