Python state machines for deployment