Remove 'is_valid_event' method
This method is no longer needed as ironic now has access to the automaton provided 'is_actionable_event' method that provides an equivalent api. Change-Id: Ib0edd2da7e36b91c3fba306133f011db5a87019f
This commit is contained in:
@@ -402,7 +402,7 @@ class NodeStatesController(rest.RestController):
|
||||
|
||||
m = ir_states.machine.copy()
|
||||
m.initialize(rpc_node.provision_state)
|
||||
if not m.is_valid_event(ir_states.VERBS.get(target, target)):
|
||||
if not m.is_actionable_event(ir_states.VERBS.get(target, target)):
|
||||
# Normally, we let the task manager recognize and deal with
|
||||
# NodeLocked exceptions. However, that isn't done until the RPC
|
||||
# calls below.
|
||||
|
||||
@@ -104,19 +104,6 @@ class FSM(machines.FiniteMachine):
|
||||
if self._states[self._current.name]['target'] is not None:
|
||||
self._target_state = self._states[self._current.name]['target']
|
||||
|
||||
def is_valid_event(self, event):
|
||||
"""Check whether the event is actionable in the current state."""
|
||||
# TODO(harlowja): remove this when
|
||||
# https://review.openstack.org/191955 merges and is made available.
|
||||
current = self._current
|
||||
if current is None:
|
||||
return False
|
||||
if self._states[current.name]['terminal']:
|
||||
return False
|
||||
if event not in self._transitions[current.name]:
|
||||
return False
|
||||
return True
|
||||
|
||||
@_translate_excp
|
||||
def initialize(self, start_state=None):
|
||||
super(FSM, self).initialize(start_state=start_state)
|
||||
|
||||
Reference in New Issue
Block a user