Move all opens in auth_token to be in context

This commit switches the use of open() to be in a with context. This
will prevent leaking file descriptors because using a context
provides an inherent close(). Prior to this commit it was possible
that an exception or error during the write() call could prevent
close() from running.

Change-Id: Ib13fe651d41f0eafea23a1c96c6c64d405de7e49
Extract test token data from auth_token middleware

This data can be used elsewhere as well.

Change-Id: I38b6c782b6d38e9e7d091f1c045a13ca10dfcc85
Add importutils and strutils from oslo

They will be used by apiclient library.

Change-Id: Ifb0d5fa1480c3701316b57d9e59507d608b11753
Allow configure the number of http retries

Allow setting the maximum number of times we want to retry to
http_connect when communicating with the Identity service.

Closes-Bug: 1209194
Change-Id: I56bff55dc808a1188d42f1643a8018a8d49012c6
Merge "Extract test token data from auth_token middleware"
Merge "Allow configure the number of http retries"
Merge "Add importutils and strutils from oslo"
Merge "Move all opens in auth_token to be in context"