With the move to the apiclient exceptions from oslo the basic HTTP error
class was renamed. This was not reflected in all places in the code.
It was also not picked up by the tests because the apiclient tests
weren't running due to a missing __init__.py file. Because this should
be backwards compatible it was added to the list in exceptions, the
check that this is available is in the (now running) apiclient tests.
Blueprint: common-client-library-2
Change-Id: I307c1083f29e3207cc86aa938043270e5c32b4bb
The exception module in oslo common code and in keystoneclient are similar.
In case of unification openstack clients, we should use modules from Oslo.
Changes of this patch:
- imported exceptions from common code instead of `apiclient.exception`
- added aliases for exceptions which was renamed
(reason: backwards compatibility)
- moved exceptions `EmptyCatalog` from `apiclient.exception` to `exceptions`
- cleaned `apiclient.exception` from duplicated exceptions
- `apiclient.__init__` and `apiclient.exceptions` are kept and labeled as
'deprecated'(reason: backwards compatibility)
bp common-client-library-2
Change-Id: Iedf4e5d753d4278d81751ba0f55fdef3566b56de
Extract the authentication code from a v2 client and move it to a series
of auth plugins. Auth plugins each represent one method of
authenticating with a server and there is a factory method on the base
class to select the appropriate plugin from a group of arguments.
When a v2 client wants to do authentication it will create
a new v2 auth plugin, do the authentication and then take that result
for the client to use.
Change-Id: I4dd7474643ed5c2a3204ea2ec56029f926010c2c
blueprint: auth-plugins
We don't need vim modelines in each source file, it can be set in
user's vimrc.
Change-Id: Ic7a61430a0a320ce6b0c4518d9f5d988e35f8aae
Closes-Bug: #1229324
Provides the framework for creating authentication plugins and using
them from a session object.
To allow this system to co-exist with the original client there is a bit
of a hack. The client object itself is now also an authentication
plugin, that supports the original client pattern. If a client is
created without a session object then that session object uses the
client as it's authentication plugin.
Change-Id: I682c8dcd3705148aaa804a91f4ed48a5b74bdc12
blueprint: auth-plugins
Allow discovery of the API versions a server supports and create an
appropriate client based on this.
Implements: blueprint api-version-discovery
Change-Id: I63e6759889066a784dc47e35152c82e1ead7951d
A wrapper around a number of connection variables. This will be extended
later with principals such as Kerberos authentication and http sessions.
The intent is that this session object will become the basis for all
other client library communications in OpenStack (as keystone wants to
control things like authentication for everybody).
Change-Id: I8ee728c49d554659d7057ebf17d0f8ceea4d7d8e
Part of: blueprint auth-plugins
- Add checking the openssl return code 2, related to following review
https://review.openstack.org/#/c/22716/
- Add support set subprocess to the cms, when we already know which
subprocess to use.
Closes-Bug: #1142574
Change-Id: I3f86e6ca8bb7738f57051ce7f0f5662b20e7a22b
The new apiclient.exceptions hierarchy is more comprehensive
and it covers almost all HTTP error status codes. These
exceptions can be used in novaclient, keystoneclient,
glanceclient, and other client projects thus providing a
single inteface.
Users can have benefit from OpenStack clients raising exceptions
of known classes while now every client has its own classes making
difficult to catch, e.g., NotFound for every client.
Change-Id: Ia7b25880e0ffca3526525a0f0e77c7e77c4f0076
Create a function out of the standard request call that handles common
headers like user agent and logging.
This makes future changes easier to digest.
Change-Id: Ia25f997df64efdce27c8fb815e544922940145c3
The Conflict Exception is added for HTTP error code 409.
However this exception is never raised as this class is not added to
the error_code map and always raises the ClientException whenever a
409 code is returned.
Fixes bug #1168826
Change-Id: I7045eae33533ff603f4aab61ea988264b46f0d09
* Implement correct certificate verification
* Add requests to tools/pip-requires
* Fix OS_CACERT env var help text
* Add info to README
* Rework tests to use requests
Pinned requests module to < 1.0 as 1.0.2 is now current in pipi
as of 17Dec2012.
Change-Id: I120d2c12d6f20ebe2fd7182ec8988cc73f623b80
Cleans up the code around exception handling and logging
when first authenticating (which often returns an unscoped token).
There's no need to be logging an exception on an expected empty
catalog and moreover the except block was a bare "except" which
could mask other errors.
Fixes bug 1070493
Change-Id: I5e791e95ce3f9ab77723a7f4698cb11b169dacfb
Bug: 1028799
No traceback, if service is unavailable; error out gracefully.
* keystoneclient/exceptions.py
ServiceUnavailable: New class to handle 503 status code.
Add the new class to list of handled exceptions.
Change-Id: I39a8ac594ef922d682731a926be26c8b6f648f9d