opdemand/deis — pull request #716 by bacongobbler (2014-04-10 23:01:13+00:00)
Title: feat(controller): add container state via FSM

This makes a container's state directly managed via a Finite State Machine (see http://en.wikipedia.org/wiki/Finite-state_machine).

With this new behaviour, containers can be in one of 5 different states:

1) up
2) down
3) initialized
4) created
5) destroyed

A diagram that shows the container's transitions as it goes from state to state would be nice, but is not necessary for this commit. I've noted this as a TODO feature in the documentation.

I have also set the container's FSM to protected, so that nobody can directly change the FSM's state. Only a call to the model's functions that have a @transition decorator will be able to change the state.

fixes #699