wip
Extracted machine agent test upgrade functionality

This is in prepartion for future tests which require the same
functions.
Fix test bug
Merge branch 'master' of https://github.com/juju/juju into fake-authorizer-takes-a-tag

Conflicts:
	state/apiserver/agent/agent_test.go
	state/apiserver/root.go
Remove commented out code
typo
remove debugging gre
provider/azure: sanity check cert

- Don't read an unbounded amount of data
  from management-cert-path, because users
  are prone to specifying the wrong file.
- Verify the contents are PEM.

Fixes https://bugs.launchpad.net/ubuntu/+source/juju-core/+bug/1250007
state: add Machine.WatchAddresses

Introducing a watcher for machine addresses.
We'll initially use this behind the API for
watching a relation unit's addresses, until
we have a document containing network-specific
addresses.

Also, don't update a machine doc's addresses
if they're already equal to what we want to
set them to.

Fixes https://bugs.launchpad.net/juju-core/+bug/1289815
Changed user to run mongo for admin
cmd/jujud: restrict API logins during upgrades

Use the recently introduced API login validation functionality to only
allow client and local machine agent logins while upgrade steps are
running. The goal is minimise database activity during upgrades,
specifically for schema migrations.

As well as the unit tests, this change has been heavily tested
manually.
responding to review feedback
Merge pull request #134 from axw/lp1289815-address-change-delta

state: add Machine.WatchAddresses

Introducing a watcher for machine addresses.
We'll initially use this behind the API for
watching a relation unit's addresses, until
we have a document containing network-specific
addresses.

Also, don't update a machine doc's addresses
if they're already equal to what we want to
set them to.

Fixes https://bugs.launchpad.net/juju-core/+bug/1289815
Merge pull request #144 from davecheney/fake-authorizer-takes-a-tag

Fake authorizer takes a tag
Merge pull request #143 from axw/lp1250007-azure-sanity-check-cert

provider/azure: sanity check cert

- Don't read an unbounded amount of data
  from management-cert-path, because users
  are prone to specifying the wrong file.
- Verify the contents are PEM.

Fixes https://bugs.launchpad.net/ubuntu/+source/juju-core/+bug/1250007
Merge pull request #147 from perrito666/1332110_restore_broken_with_mongo_refactor

Fix bug #1332110 :restore fails on hp and aws

After a change on how permissions are handled for users (240db2a2), the one executing mongo queries on the restore process became unable to run them. This operations seems to lack a permission failure.
The operation is now run, as others already where, as admin user.
Merge pull request #142 from mjs/client-logins-during-upgrades

cmd/jujud: restrict API logins during upgrades

Use the recently introduced API login validation functionality to only allow client and local machine agent logins while upgrade steps are running. The goal is minimise database activity during upgrades, specifically for schema migrations.

As well as the unit tests, this change has been heavily tested manually.