juju/blobstore — pull request #16 by axw (2014-09-10 11:41:46+00:00)
Title: Allow concurrent uploads, discard upon detection

I was getting bitten by issue #3 in my changes
to juju to store tools and charms in a blobstore.

The problem is addressed by changing the
ResourceCatalog interface and usage. Put now
returns a path which is initially non-empty;
UploadComplete now takes a path and records it
as the storage location. The caller is responsible
for generating a unique storage path to avoid
collisions. UploadComplete will return an
IsAlreadyExists error if a path has already
been recorded.

In PutForEnvironment we now upload on the basis
of ResourceCatalog.Put returning an empty path.
It may still be being uploaded, or the upload may
have been abandoned, so we must try anyway. If
UploadComplete returns an IsAlreadyExists error,
the redundant storage blob is removed.

Fixes #3