summaryrefslogtreecommitdiff
path: root/keystoneclient/exceptions.py
Commit message (Collapse)AuthorAgeFilesLines
* remove useless part of error messageDolph Mathews2014-07-151-3/+2
| | | | | | also did a bit of code cleanup for consistency Change-Id: I48832c36e1a8b5a0029598dc74aaeaa3b3d2a66f
* Add /role_assignments endpoint supportRodrigo Duarte Sousa2014-05-271-0/+4
| | | | | | | | | | | | | | | | | This patch adds role assignments list support to keystoneclient. Created RoleAssignment resource and RoleAssignmentManager classes. RoleAssignmentManager only implements the list() method, the other inherited methods from base.CrudManager raises a MethodNotImplemented error with customized messages. This bp is complimented with the OSC part: https://blueprints.launchpad.net/python-openstackclient/+spec/roles-assignment-list Change-Id: I164b58b67ff42320238e943ddfa9d0a8aadd0a6d Implements: blueprint roles-assignment-support Closes-Bug: #1246310
* Compressed Signature and ValidationAdam Young2014-05-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows for a new form of document signature. pkiz_sign will take data and encode it in a string that starts with the substring "PKIZ_". This prefix indicates that the data has been: 1) Signed via PKI in Crypto Message Syntax (CMS) in binary (DER) format 2) Compressed using zlib (comparable to gzip) 3) urlsafe-base64 decoded This process is reversed to validate the data. middleware/auth_token.py will be capable of validating Keystone tokens that are marshalled in the new format. The current existing "PKI" tokens will continue to be identified with "MII", issued by default, and validated as well. It will require corresponding changes on the Keystone server to issue the new token format. A separate script for generating the sample data used in the unit tests, examples/pki/gen_cmsz.py, also serves as an example of how to call the API from Python code. Some of the sample data for the old tests had to be regenerated. A stray comma in one of the JSON files made for non-parsing JSON. Blueprint: compress-tokens Closes-Bug: #1255321 Change-Id: Ia9a66ba3742da0bcd58c4c096b28cc8a66ad6569
* Add new error for invalid responseJamie Lennox2014-04-151-0/+8
| | | | | | | | | | | | There are a number of places where we expect a certain format of response. If it's not found we often end up raising a KeyError when accessing data. Create a new Exception type that is raised when a HTTP response is not appropriate for parsing and use it within authentication calls. Closes-Bug: #1307306 Change-Id: I3cf2db07a8e76ee17702130e9efb0edf640d293a
* Rename HTTPError -> HttpErrorJamie Lennox2014-04-151-0/+1
| | | | | | | | | | | | | 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
* Reuse module `exceptions` from OsloAndrey Kurilin2014-04-011-8/+12
| | | | | | | | | | | | | | | | | | 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
* Create V2 Auth PluginsJamie Lennox2014-02-211-0/+5
| | | | | | | | | | | | | | 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
* Remove vim headerEric Guo2014-02-081-2/+0
| | | | | | | | We don't need vim modelines in each source file, it can be set in user's vimrc. Change-Id: Ic7a61430a0a320ce6b0c4518d9f5d988e35f8aae Closes-Bug: #1229324
* Create Authentication PluginsJamie Lennox2014-02-041-0/+4
| | | | | | | | | | | | | | 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
* Discover supported APIsJamie Lennox2013-12-031-0/+8
| | | | | | | | 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
* Extract a base Session objectJamie Lennox2013-11-281-0/+12
| | | | | | | | | | | | 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
* Migrate the keystone.common.cms to keystoneclientLei Zhang2013-10-281-0/+9
| | | | | | | | | | | | - 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
* Merge "Add apiclient.exceptions hierarchy"Jenkins2013-08-301-159/+2
|\
| * Add apiclient.exceptions hierarchyAlessio Ababilov2013-08-201-159/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix License Headers and Enable Gating on H102Morgan Fainberg2013-08-271-0/+14
|/ | | | | | | | Add ASLv2 headers to files that were missing it. fixes bug #1211587 Change-Id: Iede918e1ce84993cee4ecbb2d9c2606627fa412e
* Fix and enable Gating on H404Dirk Mueller2013-08-151-30/+17
| | | | | | | Enable gating on the Hacking H404 check - docstring should start with a summary. Change-Id: I80612a15bd11f689e9e9f4dc2ff812138630ddbd
* Extract basic request callJamie Lennox2013-08-121-1/+9
| | | | | | | | 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
* Fix and enable gating on H403Dirk Mueller2013-07-131-1/+2
| | | | | | | Only a few occurrences of "multiline docstrings should end on a new line." Change-Id: I3fb4591259b1e7c8202365cbadc8967a1639254f
* Fix and enable gating on H402Dirk Mueller2013-07-121-2/+2
| | | | | | Docstring summaries need punctuation. Change-Id: I1b740c13d5fedf9a625ca0807c908f651ee08406
* Fix and enable H401Dirk Mueller2013-06-271-1/+1
| | | | | | Remove leading spaces from doc comments. Change-Id: I75b055c0d64dda478c63839d44158e301900107f
* Added Conflict Exception to the exception code mapKannan Manickam2013-05-071-0/+1
| | | | | | | | | | | 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
* Merge "Add name arguments to keystone command."Jenkins2013-02-131-0/+5
|\
| * Add name arguments to keystone command.Ken'ichi Ohmichi2013-01-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds name arguments to the following subcommands: * role-delete * role-get * service-delete * service-get * tenant-delete * tenant-get * tenant-update * user-delete * user-get * user-password-update * user-role-add * user-role-list * user-role-remove * user-update Fixes bug 1100648 Change-Id: I73c08c0ba553a72ec57ff3a684a00be4ef1294a6
* | Treat HTTP code 400 and above as error.Lin Hua Cheng2013-02-051-0/+9
|/ | | | | | Fixes bug 1116559. Change-Id: I4b12176599686f7e545b63c8e54cf9da6a1f963e
* Use requests module for HTTP/HTTPSDean Troyer2012-12-181-7/+7
| | | | | | | | | | | | | * 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
* Merge remote-tracking branch 'origin/feature/keystone-v3' into HEADDolph Mathews2012-10-301-0/+4
|\ | | | | | | | | | | | | Conflicts: tests/v2_0/test_tenants.py Change-Id: I37037e60210edd574da86b1dc07aa73e6761e338
| * v3 Domain/Project role grantsDolph Mathews2012-10-091-0/+4
| | | | | | | | Change-Id: Idbe0702b42603d6f9f133c9f1855ea9b4f222066
* | Don't log an exception for an expected empty catalog.Gabriel Hurley2012-10-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Handle "503 Service Unavailable" exception.Bhuvan Arumugam2012-09-241-1/+10
|/ | | | | | | | | | | | 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
* pep8 1.1 changes and updatesJoe Heck2012-06-011-2/+6
| | | | Change-Id: I8bc3582bb3f35a3d841bb1e8c03b62ba61ff92d7
* Improved error message when unable to communicate with keystone.Gabriel Hurley2011-12-071-1/+3
|
* Improved logging/error messages.Gabriel Hurley2011-11-171-2/+3
|
* Initial commit.Gabriel Hurley2011-10-251-0/+129