Exit transition immediately if already in the desired state.

This commit is contained in:
Lance Stout 2012-08-10 12:41:02 -07:00
parent 4e12e228cb
commit d11a67702e

View file

@ -90,6 +90,9 @@ class StateMachine(object):
log.debug("Could not acquire lock")
return False
if self.__current_state == to_state:
return True
while not self.__current_state in from_states:
# detect timeout:
remainder = start + wait - time.time()