environs: remove Name method from environs.Environ

This change removes the Name method from the Environ interface.

The rational for this comes from the work at the Identity sprint which has identified that the canonical identifier for an environment is its UUID. This downplays the importance of the Environ.Name() method, so the method has been removed and replaced by the same method availble on Environ.Config(). As these two _MUST_ be the same, the effect on the caller is nil.

It should be noted that this change identified several places where Environ.Name() and Environ.Config().Name() were not reporting the same values and these have been fixed.
worker.Runner now treats nil error as dont-restart
Merge branch 'master' into copy-session
driveby: fix slow tests
Merge pull request #364 from mjs/upgrade-steps-worker-error-handling

cmd/jujud: fix upgrade worker error handling

If the connection to state is lost then return an error so that the machine agent will restart. For other errors, don't return the error because we want the machine agent to stay running wait for user intervention.

This change also adds tests for the handling of upgradeWorkerContext's UpgradeComplete channel. This was previously untested.
Fix review comments
Merge pull request #361 from wallyworld/copy-session

Do not use global sessions

Each time a mongo interaction is performed, the session is copied using session.Copy() to ensure a fresh socket is used if needed. The basis of the change is to remove the "global" mongo collections on state.State and refresh each time one is used. A similar approach is used with the transaction runner.

The changes essentially follow the mgo driver guidelines:
newSession := session.Copy()
defer newSession.Close()
<do stuff with newSession>

During bootstrap, state.State is created using a session that has not had Login() called. For this case, the session is not copied as there are no stored credentials yet. An authenticated bool is added to state.State for this purpose.
mongo: reduce min/max oplog size

Reduce oplog minimum size to 512MB,
and maximum size to 1024MB.

See comments on bug for backstory
and analysis.

Fixes https://bugs.launchpad.net/juju-core/+bug/1344940
Propagate machine jobs from state to StartInstance

The provisioner is updated to send the correct set
of machine jobs from state through to the broker's
StartInstance call. This allows us to now expose and
load balance the correct set of ports for state
servers in Azure.

Fixes https://bugs.launchpad.net/juju-core/+bug/1347371
Revert "Do not use global sessions"
Merge pull request #372 from juju/revert-361-copy-session

Revert "Do not use global sessions"
Merge pull request #365 from davecheney/149-environs-drop-name-method

environs: remove Name method from environs.Environ

This change removes the `Name` method from the `Environ` interface.

The rational for this comes from the work at the Identity sprint which has identified that the canonical identifier for an environment is its UUID. This downplays the importance of the `Environ.Name()` method, so the method has been removed and replaced by the same method available on `Environ.Config()`. As these _MUST_ be the same, the effect on the caller is nil.

It should be noted that this change identified several places where `Environ.Name()` and `Environ.Config().Name()` were not reporting the same values and these have been fixed.
Merge pull request #291 from gabriel-samfira/windows-run-hooks

Make runCharmHook windows compatible

On windows, hooks (live every other executable) need an extension. This branch adds support for running powershell and batch scripts as hooks. For powershell, we need to pass in exta arguments to exec.Command()

This branch depends on https://github.com/juju/juju/pull/287
Merge pull request #371 from axw/lp1347371-worker-provisioner-jobs

Propagate machine jobs from state to StartInstance

The provisioner is updated to send the correct set
of machine jobs from state through to the broker's
StartInstance call. This allows us to now expose and
load balance the correct set of ports for state
servers in Azure.

Fixes https://bugs.launchpad.net/juju-core/+bug/1347371
Merge pull request #368 from axw/lp1344940-oplog-smaller

mongo: reduce min/max oplog size

Reduce oplog minimum size to 512MB,
and maximum size to 1024MB.

See comments on bug for backstory
and analysis.

Fixes https://bugs.launchpad.net/juju-core/+bug/1344940
Adds support for stripped-down Ubuntu images which may not have kvm-ok in their path.
Merge pull request #340 from katco-/lp-1342747-kvm

Adds support for stripped-down Ubuntu images which may not have kvm-ok in their path.

https://bugs.launchpad.net/juju-core/+bug/1342747
Add Tests for internal helpers

Test internal helper functions
Merge branch 'master' into actionresults-watcher
Merge pull request #366 from fwereade/worker-finish-nil

worker.Runner now accepts nil worker returns

...and treats them as meaning "this worker has finished and does not need to be restarted".