Download tools from API server

We will be eliminating the use of provider
storage for tools. This is a step in that
direction: hiding the use of provider storage
behind an HTTP API provided by the API server
for fetching tools. Later we will change the
backend to fetch the tools from GridFS, when
that work has been implemented.
environs/cloudinit: use aria2 to download tools from API servers

Now that we are serving tools in the API server, we must consider
the availability of the API server at the time a machine is
provisioned. The aria2 package is an alternative to curl that
is capable of failing over to additional sources and optionally
downloading chunks in parallel.

Note: curl can be built with support for Metalink, which would
have been a more conservative option. Unfortunately the version
of curl packaged in Ubuntu does not have Metalink support enabled.
provider/local: serialise tools in cloud-config

The local provider always has tools available
locally, and user-data for lxc and kvm does
not have the size limitations as in cloud providers.
Thus, we can safely serialise the tools tarball
into user-data in the local provider.
state/apiserver: fix sprintf, log errors

Log errors in sendError functions, and
change signature to not return error.
environs/cloudinit: retry tools download indefinitely
state/apiserver: use errors, fix sprintf
Change sync-tools to use API

environs/sync now operates on two interfaces:
 - a ToolsFinder, which is used for finding
   tools in the destination
 - a ToolsUploader, which is used for uploading
   missing tools to the destination

There are two implementations of ToolsFinder
and ToolsUploader: one using Storage, and one
that uses the client API.

In cmd/juju we now use the client API unless
--local-dir is specified. --public now only
takes effect if --local-dir is specified. This
is redundant anyway, given the metadata plugins.
provider/local: disable prereq checking in tests

We have tests for prereq checking, we don't need
to do it everywhere.
This time for real
Merge pull request #608 from axw/cloudinit-download-tools-apiserver

Download tools from API server

We will be eliminating the use of provider storage for tools. This is a
step in that direction: hiding the use of provider storage behind an HTTP
API provided by the API server for fetching tools. Later we will change the
backend to fetch the tools from GridFS, when that work has been
implemented.

Now that we are serving tools in the API server, we must consider the
availability of the API server at the time a machine is provisioned. The
aria2 package is an alternative to curl that is capable of failing over to
additional sources and optionally downloading chunks in parallel.
Note: curl can be built with support for Metalink, which would have been a
more conservative option. Unfortunately the version of curl packaged in
Ubuntu does not have Metalink support enabled.

The local provider always has tools available locally, and user-data for
lxc and kvm does not have the size limitations as in cloud providers. Thus,
we can safely serialise the tools tarball into user-data in the local
provider.
Fix race in test.
Rework auth checks for gccgo.
simplify the change
Simplify more
Merge pull request #633 from howbazaar/fix-gccgo-failure

Rework auth checks for gccgo.

gccgo has problems comparing concrete types and interfaces. I'm betting it is actually only interfaces implemented by non-pointer types, but hey, I'm not a compiler writer.\

Reworks the auth checks.
Add doc comments for sync-tools changes
Merge pull request #625 from axw/synctools-api

Change sync-tools to use API

environs/sync now operates on two interfaces:
 - a ToolsFinder, which is used for finding
   tools in the destination
 - a ToolsUploader, which is used for uploading
   missing tools to the destination

There are two implementations of ToolsFinder
and ToolsUploader: one using Storage, and one
that uses the client API.

In cmd/juju we now use the client API unless
--local-dir is specified. --public now only
takes effect if --local-dir is specified. This
is redundant anyway, given the metadata plugins.
Merge pull request #631 from howbazaar/fix-envuser-race

Fix race in test.
Add bootstrap flag to allow failed bootstraps to keep the environment
Better warning message