Refactor rest-client and identity v2-client
Simplify rest client bases into a single base client class.
There is a lot of duplicated code in the way the REST client classes are
constructed to enable both JSON and XML requests. Duplicate code leads
to subtle errors and inconsistencies in the way that
service client classes behave.
This patch aims to simplify the class hierarchy for the REST client classes
by making the XML service client class inherit from
the JSON service client class.
Steps to use one xml-client:
1) json-service-clients inherit rest-client
2) xml-service-clients inherit json-service-clients
3) redefine option self.TYPE for xml-service-clients
4) use new method self.get_headers() instead option self.headers,
if needed, but in most cases there is no need to set up headers
at all in service clients.
Closes-Bug: 1269489
Partially-implements: bp refactor-rest-client
Change-Id: Ie43d10affc981d3446b1296cf05ef595154276a9
7 files changed