selinon.failures module¶
Task and flow failure handling.
-
class
selinon.failures.
Failures
(raw_definition, system, flow, last_allocated=None, starting_nodes=None, predicates=None)[source]¶ Bases:
object
Node failures and fallback handling.
-
all_fallback_nodes
()[source]¶ Compute all fallback nodes.
Returns: all nodes that are used as fallback nodes
-
all_waiting_nodes
()[source]¶ Compute all nodes that have defined a fallback.
Returns: all nodes that for which there is defined a callback
-
static
construct
(system, flow, failures_dict)[source]¶ Construct Failres.
Parameters: - system – system context
- flow – a flow to which failures conform
- failures_dict – construct failures from failures dict
Return type:
-
dump2stream
(stream)[source]¶ Dump failures to the Python config file for Dispatcher.
Parameters: stream – output stream to dump to
-
dump_all_conditions2stream
(stream)[source]¶ Dump all condition sources that are present to a stream.
Parameters: stream – output stream to dump to
-
static
failure_node_name
(flow_name, failure_node)[source]¶ Create a failure node name representation for generated Python config.
Parameters: - flow_name – name of flow for which the representation should be created
- failure_node – a node from graph of all failure permutations
Returns: variable name
Return type:
-
fallback_nodes_names
()[source]¶ Compute names for all nodes that are started by fallbacks.
Returns: names of nodes that are started by fallbacks in all failures
-