The ironic.common.fsm Module

class ironic.common.fsm.FSM[source]

Bases: automaton.machines.FiniteMachine

An ironic state-machine class with some ironic specific additions.

add_state(*args, **kwargs)[source]

Adds a given state to the state machine.

Parameters:
  • stable – Use this to specify that this state is a stable/passive state. A state must have been previously defined as ‘stable’ before it can be used as a ‘target’
  • target – The target state for ‘state’ to go to. Before a state can be used as a target it must have been previously added and specified as ‘stable’

Further arguments are interpreted as for parent method add_state.

add_transition(*args, **kwargs)

Adds an allowed transition from start -> end for the given event.

initialize(*args, **kwargs)[source]
process_event(*args, **kwargs)

Trigger a state change in response to the provided event.

Returns:Effect this is either a FiniteMachine.Effect or an Effect from a subclass of FiniteMachine. See the appropriate named tuple for a description of the actual items in the tuple. For example, FiniteMachine.Effect‘s first item is reaction: one could invoke this reaction’s callback to react to the new stable state.
Return type:namedtuple

This Page