environs/tools: fix SHA256 summing

SHA256 summing of archives was totally
broken; summing the contents rather
than the resulting tgz file. Changed
Archive to just tgz, and added another
function to do the hash.
Update deps for lxc testing.
Merge pull request #582 from sinzui/makefile-changes-for-testing

Update deps for lxc testing.
Added upgradeWorkerContext.IsUpgradeRunning()

This cleans up some previous uses of the UpgradeCompleted channel and
will be helpful for upcoming changes to the upgrader worker.
worker/upgrader: allow downgrades for aborted upgrades

In some cases upgrades will need to be aborted and the best course of
action will be to restart in to the previous agent version. This
revision modifies the upgrader worker so that it will allow downgrades
to the pre-upgrade tools version, but only if an upgrade is still in
progress. This allows the upgrade-steps worker to trigger a downgrade
to the previous agent version by changing the environment's
agent-version.
cmd/jujud: downgrade agent-version if a state fails to come up for upgrade

If during an upgrade one or more state servers fail to signal it is
ready for upgrade, the master state server will modify the environment
agent version to trigger a downgrade to the previous agent version.

So that the upgrader worker will accept downgrades to the previous
agent version (it normally won't), upgradeWorkerContext's
IsUpgradeRunning method is now passed to the upgrader
worker. Downgrades to the previous agent version are allowed if an
upgrade is in progress.
cmd/jujud: added wrench for state server upgrade wait

To support manual testing of a state server failing to say it's ready
for upgrade.
Merge pull request #555 from mjs/upgrader-allow-limited-downgrade

Support downgrades to previous version in the case of aborted upgrades

In some cases upgrades will need to be aborted and the best course of action will be to restart to the previous agent version. This PR modifies the upgrader worker and machine agent so that it will allow downgrades
to the pre-upgrade tools version, but only if an upgrade is still in progress. This allows the upgrade-steps worker to trigger a downgrade to the previous agent version by changing the environment's agent-version.
Update dependencies to use gomaasapi rev 53
Handle an error that was previously ignored
Formatting
Formatting
Merge pull request #587 from wallyworld/nil-pointer-fixes

Nil pointer fixes

Fixes: https://bugs.launchpad.net/bugs/1358585

Add missing error handling.
Log ssh commands at trace level

Reduce noise for when we start
serialising tools in cloud-config.
Upgrade selection increments minor version by 1
cloudinit: s/AddFile/AddTextFile/, add AddBinaryFile
Merge pull request #577 from axw/environs-tools-archive

environs/tools: fix SHA256 summing

SHA256 summing of archives was totally
broken; summing the contents rather
than the resulting tgz file. Changed
Archive to just tgz, and added another
function to do the hash.
Merge pull request #586 from wallyworld/gomaasapi-rev53-trunk

Update dependencies to use gomaasapi rev 53

Fixes: https://bugs.launchpad.net/bugs/1190986
Merge pull request #590 from wallyworld/next-upgrade-version-trunk

Upgrade selection increments minor version by 1

Forward port from 1.20.

Fixes: https://bugs.launchpad.net/bugs/1359435
Merge pull request #573 from axw/cloudinit-addfile-bytes

Change cloudinit.Config.AddFile to take []byte

In preparation for serialising tools in cloud-config for bootstrap
machines.

Also, log ssh commands at trace level

(Reduce noise for when we start serialising tools in cloud-config.)