lp://staging/~wallyworld/goose/public-containers

Created by Ian Booth and last modified
Get this branch:
bzr branch lp://staging/~wallyworld/goose/public-containers
Only Ian Booth can upload to this branch. If you are Ian Booth please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Ian Booth
Project:
Go OpenStack Exchange
Status:
Merged

Recent revisions

49. By Ian Booth

Code review tweaks

48. By Ian Booth

Ensure we handle public urls with and without trailing slash

47. By Ian Booth

Fix tests

46. By Ian Booth

Merge trunk and resolve conflicts

45. By Ian Booth

Rework non authenticating client and fix some tests

44. By Ian Booth

Add support for container ACLs (public and private) and public swift clients to access the public containers

43. By Dimiter Naydenov

nova double: Rest of HTTP API.

This implements the rest of the HTTP API of the Nova testing double:
* servers
* servers/detail
* servers/<id>/os-security-groups
* servers/<id>/action (add/removeSecurityGroup; add/removeFloatingIp)
* os-security-groups
* os-security-group-rules
* os-floating-ips

There are a few things to change in order to integrate with the Nova client and the local "live" tests, but this will come in a follow-up.

R=fwereade, rog, jameinel
CC=
https://codereview.appspot.com/6940073

42. By Ian Booth

Adds to swift API to provide juju-core features.

The main additions are:

- List (list the contents of a container)
- URL (the URL of an object, requires authentication to access)
- SignedURL (a temporary URL used to access an object without authorisation)
- GetReader, PutReader (get/put objects taking data from a Reader rather than a
byte array)

There's no guaranteed way to get the SignedURL of an object, so for now the
authenticated URL is returned.

R=jameinel
CC=
https://codereview.appspot.com/6941063

41. By Ian Booth

Retry OpenStack requests when throttled

When making a request to OpenStack, it may fail with a 413 if too many requests have been made in a period of time. In such cases, the response headers
will contain a Retry-After value indicating that the client and resend the request after X seconds. This branch enhances the Goose HTTP client to seamlessly
retry the request up to 3 times before it gives up.

Note that other times a 413 may be returned is when a resource limit truly has been exceeded, eg creating a floating ip adress. In this case, the request is not
resent and the call fails immediately.

A fair bit of refactoring in the HTTP client was required to get things in place to allow the request to be retried. I also modified the nova test suite to support
live and local testing so that I could ensure the test double could be made to generate 413s but then found that the nova test double stuff is not quite all landed yet. The
new testing stuff has been left in place though for when everything catches up.

I needed to capture the log output in the new test so added a Logger attribute to the HTTP client. If no logger is passed in, it defaults to the std Go logger.

The retry stuff in this branch fixes some previously broken tests. I modified the remaining broken tests to make them all pass against the live system.
The only ones that fail now are the floating ip ones and then only if some ip addresses are allocated and left hanging around before the test is run.
We can look to make the tests clean up these perhaps.

R=jameinel
CC=
https://codereview.appspot.com/6920045

40. By Ian Booth

Improved error handling

This branch improves how errors are defined and handled.

The current version introduces changes suggested in code reviews.

An Error interface has been defined for specifying erros with an error code. The code is used to distinguish between types of error
eg NotFound vs DuplicateValue.
Errors can be nested, and can refer to a root cause error. This allows errors to propogate up the call stack, keeping each error small and
self contained, but not discarding important root cause information. At the base level, the context will usually be data pulled from the
http repsonse, namely status code and headers, since these are usually sufficient to grok what may have gone wrong. Additional info can
be added to the ResponseData struct if required.

The determination of a NotFound error is easy - just look at the http response code and see a 404. DuplicateValue errors are more difficult, since the
OpenStack API just returns a 400 with text saying there was a duplicate. The current implementation sucks balls but ti's all we can do ATM AFAIK.

The NotFound and DuplicateValue errors will be used specifically by the juju-core code which calls goose, hence their introduction here.
Other error types can be created as required.

R=jameinel, rog, amnonbc, gz
CC=
https://codereview.appspot.com/6889049

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp://staging/~gophers/goose/trunk
This branch contains Public information 
Everyone can see this information.

Subscribers