2 Commits

Author SHA1 Message Date
Jamie Lennox
1145d9424b Use jsonutils to load adapter response
This is not technically needed, however we and the libraries we use,
aren't very good about keeping our strings and bytes straight for python
3. jsonutils has an attempt to decode stage that means we can let it
manage the correct types.

Change-Id: I2caf4a5b9a04495aa0286f2b6e3193a17ff246e5
2014-07-15 13:31:06 +10:00
Jamie Lennox
1893703b4f Session Adapters
A Session is a global object that can be shared around. There are
however many variables (those passed to session.request) that are
specific to the client that will be using that session. These often need
to be set for every request going through a client.

For this purpose we have a Session Adapter. An adapter is like a
view on a session. Where the session maintains very global state the
adapter maintains state relevant to a specific usage of a session. These
might be things like User-Agent which wants to be set per client using
the session, or possibly even auth plugins if we share a common session
object amongst a number of clients with different plugins.

Almost anything that gets passed to a Session.request() call is suitable
to go into an adapter (the exceptions are essentially the body data and
method which only makes sense per call)

Implements: blueprint session-propagation
Change-Id: I100c791806674213d3cdb5389d4b0a1cf88c82dd
2014-06-25 10:03:32 +10:00