Fix wrench build on Windows
Revert "Revert "Merge pull request #530 from ericsnowcurrently/backups-storage""

This reverts commit 68c71ec48f16eac6f8aff2a66496afb148ec95c6.
Merge pull request #607 from wallyworld/agent-version-on-startup-trunk

Merge pull request #602 from wallyworld/agent-version-on-startup

Set a machine's tools version when the agent starts

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

The referenced bug shows an error initialising container support when a machine's agent starts up.

2014-08-20 22:06:07 ERROR juju.provisioner container_initialisation.go:154 cannot get tools from machine for lxc container
2014-08-20 22:06:07 ERROR juju.provisioner container_initialisation.go:95 starting container provisioner for lxc: initialising container infrastructure on host machine: agent tools for machine 5 not found
2014-08-20 22:06:07 ERROR juju.worker runner.go:218 exited "5-container-watcher": initialising container infrastructure on host machine: agent tools for machine 5 not found

The only way I can see that happening is if the container worker starts before the upgrade work sets the tools version. That can happen as both upgrade worker and container worker start up in parallel.

I moved the logic to set the tools version on a machine from the upgrade worker to the agent's APIWorker() method, thus ensuring the tools version is set early before it is needed.

I also found what looks to be bad logic in the container initialisation worker - the code to stop the worker was duplicated and one of the copies was called in the wrong place; it looked like the worker was terminated after the first container type was handled, meaning subsequent container types added to the machine may not have been started properly.
Merge pull request #612 from wallyworld/fix-machine-test

Make some machine/unit agent tests more robust

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

If a machine is marked as Dead part way through agent startup, as happens in some tests, the agent exits without realising it needs to terminate.
Fix compile errors
Generate "system identity" in jujud bootstrap

I recently moved the system-identity generation
up the stack from each of the providers into
environs/bootstrap common code. This caused a
slow down in tests that weren't previously
generating the key as they use the dummy provider.

This should never have been in the client side;
I'm moving generation of the system identity
into bootstrap.

Fixes https://bugs.launchpad.net/juju-core/+bug/1361971
Fix tests
cmd/jujud: test contents of system-identity written
Merge pull request #615 from wallyworld/agent-version-on-startup-master

Agent version on startup master

Fixes: https://bugs.launchpad.net/bugs/1359800

Was reverted because it was thought to be causing a regression, but that wasn't the case. So resubmitting.
Fix to state/apiserver/uniter_test as requested by davecheney

No longer cares what order Actions arrive in.
Fix to state/apiserver/uniter_test as requested by davecheney

Addressed comments / request for helper function.
Merge pull request #616 from axw/lp1361971-bootstrap-generate-systemidentity

Generate "system identity" in jujud bootstrap

I recently moved the system-identity generation
up the stack from each of the providers into
environs/bootstrap common code. This caused a
slow down in tests that weren't previously
generating the key as they use the dummy provider.

This should never have been in the client side;
I'm moving generation of the system identity
into bootstrap.

Fixes https://bugs.launchpad.net/juju-core/+bug/1361971
Trivial syntax tweak as per PR 448 comments
Merge pull request #448 from binary132/uniter-test-fix

Fix to state/apiserver/uniter_test as requested by davecheney

No longer cares what order Actions arrive in.
Implemented disable-network-management environment flag
Bump build number when uploading tools during bootstrap

CI was broken due to expectations of build number
being bumped when we upload tools for bootstrap.
Bumping the build number also makes it more straightforward
to identify tools that have been uploaded vs. official ones.
Merge pull request #618 from dimitern/lp-1361374-disable-network-management-flag

Added disable-network-management environment flag

A new environment config flag "disable-network-management" added,
which is false when missing and by default, but when it's "true":
 * MAAS provider is not creating a network bridge or bringing eth0
   up and down during cloudinit.
 * The networker worker is always run in safe mode, so no subsequent
   changes to the network config are made, or and ifup/ifdown commands
   will be run.

This is intended as a "safety switch" to workaround a few bugs happening
when using Juju on MAAS mostly, until Juju's network model works and integrates
better with MAAS. List of related bugs:
 * http://pad.lv/1361374 - maas provider assumes machine uses dhcp for eth0
 * http://pad.lv/1353008 - MAAS Provider: LXC did not get DHCP address, stuck in "pending"
 * http://pad.lv/1345433 - cloud-init network error when using MAAS/juju
 * http://pad.lv/1341524 - juju/MAAS deployed host with bonding configured via preseed missing eth0 from bond on first boot

In any cases where MAAS and Juju are both trying to manage networking
on machines, set "disable-network-management: true" in your environments.yaml
file before bootstrap.
Merge pull request #620 from gabriel-samfira/windows-fix-wrench

Fix wrench build on Windows

This PR fixes the building of wrench on Windows (and by extension, jujud.exe, where its used).
Merge pull request #619 from axw/bootstrap-uploadtools-bump-build

Bump build number when uploading tools during bootstrap

CI was broken due to expectations of build number
being bumped when we upload tools for bootstrap.
Bumping the build number also makes it more straightforward
to identify tools that have been uploaded vs. official ones.
Merge pull request #611 from ericsnowcurrently/backups-storage

Un-revert PR #530

This reverts commit 68c71ec48f16eac6f8aff2a66496afb148ec95c6.  It simply re-applies a93e1df919450377b6dab707552582fd604cd8cf.