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:
Joshua Harlow
2015-09-02 16:51:08 -07:00
parent b415a6e551
commit a3e8b07ae3
2 changed files with 1 additions and 14 deletions
+1 -1
View File
@@ -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.
-13
View File
@@ -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)