juju/juju — pull request #1312 by waigani (2014-12-12 03:38:12+00:00)
Title: Add new State method, RemoveAllEnvironDocs, use it in apiserver

Add a new method on State, RemoveAllEnvironDocs, which removes all
documents from all collections in state.multiEnvCollections as well as
the environments document associated with the given state. The method
is intended to be called after a non-state-server environment is
destroyed.

Call RemoveAllEnvironDocs at the end of
"apiserver/client".Client.DestroyEnvironment(), when we are sure all
cleanup steps have been taken and only if the destroyed environment was
not the state-server.

A followup branch will add a safeguard to destroying the state server,
allowing it only to be destroyed if there are no other environments.
That branch will take advantage of the new destroyTwoEnvironmentsSuite
introduced in this branch.

This branch depends on: http://reviews.vapour.ws/r/625/