Hi,
this patchset adds deployment state attribute. This attribute will be used for
tracking deployment's state which will be needed especially for doing rollback
when launching a deployment. It also replaces 'status' method which computed deployment's
state from states of all instances.
This patchset introduces state transitions (IOW now it's not possible to change
deployment's state from 'running' to 'pending' or from 'stopped' to 'shutting down').
deployment's state is now mostly changed on a user's action (e.g. a user clicks stop
button -> state is changed to 'shutting down'), though some transitions are done
automatically ('pending' -> 'running', 'shutting down' -> 'stopped', all rollback
state transitions will be automatic too).
Drawback of setting state when an action is performed is that deployment's state may not describe
real state of all instances properly, for example if a deployment is running and all instances are
suddenly changed to 'stopped' (from outside of conductor), then deployment's state will be 'incomplete'
until a user stops/deletes the deployment from conductor.
Which reminds me I've added another deployment state: 'incomplete', this state is used when a deployment
is running and then some (or all) instances unexpectedly change state (wiki page Robust_instance_launching
is updated too).