state/apiserver/uniter: fix test

When authenticating, against a unit in state, it is the Entity, not the Tag that takes priority.
state/apiserver/uniter: remove panic

Remove an unnecessary panic from the uniter.

Also driveby in the usermanager to clean up the logic.
Revert "state/apiserver/uniter: fix test"

This reverts commit a118ca1214ebe6eb35d80180cb92f751a9b039e7.
Don't restart mongo every time jujud starts.

Add a public method to let us know if the service exists as expected.
Check to see if the service already exists before writing it out again.
Refactor the upstart exists to use once source, and fix the tests so it doesn't create a braindead empty upstart file first.
Start the service if we need to.
provider/manual: add manual-provider defaults to prepared config

Prepare calls "validate", which was not updating the config
with manual-provider specific attributes (Validate calls validate
and updates the config too). This meant that the manual-provider
config attribute defaults were not being populated in the .jenv
file, so we were not using SSH storage from the client when we
should have been.

Fixes https://bugs.launchpad.net/juju-core/+bug/1347715
Merge pull request #429 from axw/lp1347715-provider-manual-prepare

provider/manual: add manual-provider defaults to prepared config

Prepare calls "validate", which was not updating the config
with manual-provider specific attributes (Validate calls validate
and updates the config too). This meant that the manual-provider
config attribute defaults were not being populated in the .jenv
file, so we were not using SSH storage from the client when we
should have been.

Fixes https://bugs.launchpad.net/juju-core/+bug/1347715
provider/manual: don't alter config in provider.Open

(Follow up to #429)

I unintentionally changed other users of the validate
function, which *shouldn't* just add defaults to the
config. For example, Open should just take the config
it's given.
provider/manual: ignore stderr when checking for existence of agents dir

We run an ssh command in StateServerInstances to verify that the bootstrap
machine is provisioned. We were accidentally considering that non-empty
stderr constituted a lack of environment, while we should only have been
considering stdout.

Fixes https://bugs.launchpad.net/juju-core/+bug/1347715
Move mgo dependency forward to get bug fix

Addresses the "rescanned document misses transaction in queue" issue
as per LP #1318366.
Merge pull request #424 from howbazaar/fix-juju-db-upstart-rewrites

Fix juju db upstart rewrites

Export a method from the Service types - Exists.

Use this in the mongo ensure method.
Merge pull request #423 from davecheney/163-remove-panic

163 remove panic

Remove an unnecessary panic from the uniter.

Also driveby in the usermanager to clean up the logic.
Merge pull request #433 from mjs/mgo-update

Move mgo dependency forward to get bug fix

Addresses the "rescanned document misses transaction in queue" issue as per LP #1318366.
provider/manual: look for "no-agent-dir" in StateServerInstances

Look for a more meaningful string, and reject all
other output as an error.
Merge pull request #431 from axw/lp1347715-provider-manual-stateserverinstances-ignore-stderr

provider/manual: ignore stderr when checking for existence of agents dir

We run an ssh command in StateServerInstances to verify that the bootstrap
machine is provisioned. We were accidentally considering that non-empty
stderr constituted a lack of environment, while we should only have been
considering stdout.

Fixes https://bugs.launchpad.net/juju-core/+bug/1347715
Fix the test to make sure the dir exists.
Merge pull request #430 from axw/provider-manual-fix-pr429

provider/manual: don't alter config in provider.Open

(Follow up to #429)

I unintentionally changed other users of the validate
function, which *shouldn't* just add defaults to the
config. For example, Open should just take the config
it's given.
Hard code logdir/datadir to Ubuntu paths

We should never use the client's OS to
decide how to form paths for the target.
This change hardcodes an Ubuntu series
to generate the paths for now, until
Windows support is in.

Fixes https://bugs.launchpad.net/juju-core/+bug/1342725
Merge pull request #438 from howbazaar/fix-mongo-again

Fix the test to make sure the dir exists.

The mocking was masking a real issue with the directory not existing.
state/apiserver: fix test for Go 1.3
Merge pull request #440 from axw/lp1342725-hardcode-ubuntu-paths

Hard code logdir/datadir to Ubuntu paths

We should never use the client's OS to
decide how to form paths for the target.
This change hardcodes an Ubuntu series
to generate the paths for now, until
Windows support is in.

Fixes https://bugs.launchpad.net/juju-core/+bug/1342725