ironic-inspector/ironic_inspector/test
dparalen 7e72ceffd1 Terminal state transitions in transactions
Multiple spots were not using DB transactions when processing the terminal
state transitions (error, abort, finish, timeout). The pattern looked like
this:

    node_info.fsm_event(istate.Events.error)
    # more code
    node_info.finished(error='Oops!')

which led to brief periodes of state inconsistency of NodeInfo records in
the DB.

This patch refactors the NodeInfo.finished() method to require a terminal state
transition to perform as part of the NodeInfo state update:

   NodeInfo().finished(istate.Events.finish)
   NodeInfo().finished(istate.Events.abort, 'Canceled by operator')

This patch also introduces a new state: aborting to allow the inspector to
try call power-off the node before marking the introspection aborted.

There's a new DB migration since the new state implies a schema change too
(Enum).

Closes-Bug: #1721233
Closes-Bug: #1721230
Closes-Bug: #1723384

Change-Id: I0bb051d1956a996ed006d55a5ca2d670d9455047
2017-12-19 18:15:31 +01:00
..
inspector_tempest_plugin Update tests to do not use deprecated test.services() 2017-10-17 15:36:45 +02:00
unit Terminal state transitions in transactions 2017-12-19 18:15:31 +01:00
__init__.py Remove the generic eventlet monkey patch from test 2016-11-18 10:35:53 +01:00
base.py Add request context and policy enforcement 2017-10-13 11:55:52 +00:00
functional.py Refactoring the firewall 2017-10-19 16:38:15 +02:00