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.
Fix up a race condition in the aggregator test.

The code assumed that 'go a(); go b()' would always call a() first, but that isn't
guaranteed by the runtime.
There was a bunch of other code that happened to work because of bad assumptions, so
I went around and cleaned them up (it assumed that it was ok for results to be of length
100 when making a request for 10 ids, which only worked because the aggregation code looped
over the input rather than looping over the result of the request).
Add some trace level logging which will hopefully help us understand why the
machine address updater keeps saying that it is updating addresses with values that haven't changed.
Address bug #1362453.

When storing the addresses of a Machine, we won't ever want to use the ScopeLinkLocal addresses,
both PublicAddress and PrivateAddress will explicitly filter them out, and they just confuse things
when dealing with addresses (at one point they were candidates for Clients to try to connect to
the API server).
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.
Use environ tag

This is a follow up branch to #553 (New EnvUser). Get the environ UUID
from the state environ tag.
Add bootstrap flag to allow failed bootstraps to keep the environment
Better warning message
Better warning message
Merge pull request #634 from wallyworld/keep-env-flag

Add bootstrap flag to allow failed bootstraps to keep the environment

Fixes: https://bugs.launchpad.net/juju-core/+bug/1362923

bootstrap now has a keep-broken flag which tells it not to cleanup after a failed bootstrap
Introduce and use FindTools provisioner API

We introduce a new FindTools API in the
provisioner facade, and move the existing
client FindTools API implementation into
the apiserver/common package. The provisioner
worker is updated to use this API instead
of going directly to provider storage (via
environs/tools.FindTools).

There are a couple of bugs already that require
this to be done, but now that we're moving tools
storage behind the API server it is imperative.

Fixes https://bugs.launchpad.net/bugs/1347984
Fixes https://bugs.launchpad.net/bugs/1304151
cmd/jujud: use appropriate timeout for run tests

Use LongWait for assertions of events that are
expected to occur, as described in testing/constants.go.

Fixes https://bugs.launchpad.net/juju-core/+bug/1362990
Merge pull request #636 from axw/provisioner-tools-api

Introduce and use FindTools provisioner API

We introduce a new FindTools API in the
provisioner facade, and move the existing
client FindTools API implementation into
the apiserver/common package. The provisioner
worker is updated to use this API instead
of going directly to provider storage (via
environs/tools.FindTools).

There are a couple of bugs already that require
this to be done, but now that we're moving tools
storage behind the API server it is imperative.

Fixes https://bugs.launchpad.net/bugs/1347984
Fixes https://bugs.launchpad.net/bugs/1304151