state: prepend environment UUID to unit document IDs

This is a step towards multi-environment state servers.
state: refactoring of env UUID upgrades tests

The tests for the upgrade steps that add environment UUID to the unit
and service collections now share common checker functions.
state: refactoring of env UUID upgrades

The the upgrade steps that add environment UUID to the unit and
service collections now share common generic implementation.
Renamed service env UUID upgrade step to be slightly clearer
state: check env UUID upgrade steps with concrete doc types

The previous generic approach is extended to also load migrated docs
into a document structs, ensuring that entity specific fields are
preserved during the migration.
state: removed Service.Unit()

State.Unit() is equivalent so Service.Unit() was redundant.
Merge pull request #824 from mjs/envuuid-units

state: prepend environment UUID to unit document IDs

http://reviews.vapour.ws/r/93/diff/
Force-destroy machine if manual provisioning fails

If manual provisioning fails, we leave a machine
record in state that can only be removed with
"juju destroy-machine --force". We change the
manual provisioning code to call destroy the machine
with force if it fails.

(Partially) fixes https://bugs.launchpad.net/juju-core/+bug/1356886
provider/bootstrap: verify credentials early, provide user-friendly error message

Verify credentials early in the bootstrap process, and if authentication
fails, provide a user friendly error message. We also remove a redundant
error message from the bootstrap failure case.

This branch only addresses OpenStack; other providers will be addressed
separately.

Partially fixes https://bugs.launchpad.net/juju-core/+bug/1362072
provider/maas: verify credentials early in bootstrap

Verify credentials early in the bootstrap process by
issuing a query to MAAS and checking the status code
on the response (i.e. check if it's 401). Provide a
user-friendly error message, and log the underlying
error at debug level.

Partially fixes https://bugs.launchpad.net/juju-core/+bug/1362072
provider/openstack: only verify credentials in Prepare, not Open
Fix import grouping
Merge pull request #863 from axw/lp1356886-manual-fail-forcedestroy

Force-destroy machine if manual provisioning fails

If manual provisioning fails, we leave a machine
record in state that can only be removed with
"juju destroy-machine --force". We change the
manual provisioning code to call destroy the machine
with force if it fails.

(Partially) fixes https://bugs.launchpad.net/juju-core/+bug/1356886
Merge pull request #864 from axw/lp1362072-providers-verify-credentials

provider/openstack: verify credentials early, provide user-friendly error message

Verify credentials early in the bootstrap process, and if authentication
fails, provide a user friendly error message. We also remove a redundant
error message from the bootstrap failure case.

This branch only addresses OpenStack; other providers will be addressed
separately.

Partially fixes https://bugs.launchpad.net/juju-core/+bug/1362072
Merge pull request #865 from axw/lp1362072-provider-verify-credentials-maas

provider/maas: verify credentials early in bootstrap

Verify credentials early in the bootstrap process by
issuing a query to MAAS and checking the status code
on the response (i.e. check if it's 401). Provide a
user-friendly error message, and log the underlying
error at debug level.

Partially fixes https://bugs.launchpad.net/juju-core/+bug/1362072
action-fail: a jujuc command for Actions to set an error state

action-fail permits an Action to set an error value which will be returned to
the stateserver upon completion of the Action.  This does not prevent
action-set from adding more values to the results map.
action-fail: a jujuc command for Actions to set an error state

action-fail now uses the ActionFinish endpoint on State, so that any
values set in the action's result map will be handed back even in the
case of a failed Action.  The final call to action-fail will be the
message which is handed back along with the fail status.
action-fail: a jujuc command for Actions to set an error state

Final refactor of action-fail for action-set and actionFinish.