Merge branch 'master' into download-backup
state/machine: use WaitAgentPresence, rename AgentAlive
state/machine: StartSync in SetAgentPresence
state/machine: check IsManager and only Sync presence watcher
presencer: make the presencer interface official
Basic integration with real Backup function
Correct package reference
state/presence: fixing issues from review
Use EnvironConfig for mongo details required by Backup
Merge pull request #106 from axw/state-backup-gofmt

state/backup: gofmt

Run `go fmt` in `state/backup`.
fixed nasty race condition
Merge branch 'master' of https://github.com/juju/juju into fix-api-params
Assert that password and mongo port are used correctly. (Currently a stub test.)
Bug #1328716: Clean up CONTRIBUTING a bit.
update to latest juju/names
Merge branch 'master' of https://github.com/juju/juju into 106-parsetag-refactor
fixups after merge from trunk
Merge pull request #103 from davecheney/106-parsetag-refactor

Update for juju/names refactor part 3

* Replace all the calls to ParseTag(tag, hint) to a specific ParseXXXTag method. 
* Where ParseTag is not called with a hint, adjust as necessary, there is one call for this in the codebase.
* Add some grossness where code like

type Unit struct { tag string }
func (u *Unit) Name() { _, id, err := names.ParseTag(tag, names.UnitTagKind); if err != nil { panic(err) } }

Into something a little more explicit using type specific ParseXXXTag methods.

In the next branch rather than storing the string form of the tag inside the Unit structure (without validation I may add), then parsing it (and possibly panicing) to get its Id, store a real Tag value in the struct then calls to name can just return the Id of the tag (or a more specific value available on the Tag's implementation type).
Handle constrained AZs

In EC2, an AZ may be "constrained", meaning that
you may not allocate new instances of certain
instance types to that AZ unless you already have
resources in that AZ. With this change we will
deal with this by attempting an a different AZ.

We'll now attempt all AZs until one either succeeds
or fails with an error other than one indicating
the AZ is constrained. We also now sort AZs by
population and then by name, to ensure the first
unit of each service is allocated to the same AZ
(barring pathological constrained AZ cases).

Fixes https://bugs.launchpad.net/juju-core/+bug/1330163
Close the state connection, and run the tests.