24 Commits

Author SHA1 Message Date
Jamie Lennox
fd0a176a49 Discover supported APIs
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
2013-12-03 12:00:03 +10:00
Jamie Lennox
2c5dcf9bf1 Extract a base Session object
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
2013-11-28 09:20:43 +10:00
Lei Zhang
0c8faa3efc Migrate the keystone.common.cms to keystoneclient
- 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
2013-10-28 23:35:56 +08:00
Jenkins
9edf7d0336 Merge "Add apiclient.exceptions hierarchy" 2013-08-30 21:01:00 +00:00
Morgan Fainberg
35deb1ae1b Fix License Headers and Enable Gating on H102
Add ASLv2 headers to files that were missing it.

fixes bug #1211587

Change-Id: Iede918e1ce84993cee4ecbb2d9c2606627fa412e
2013-08-27 00:04:03 -07:00
Alessio Ababilov
fba0cd51d9 Add apiclient.exceptions hierarchy
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
2013-08-20 14:03:26 +03:00
Dirk Mueller
dc5c33a9e5 Fix and enable Gating on H404
Enable gating on the Hacking H404 check - docstring
should start with a summary.

Change-Id: I80612a15bd11f689e9e9f4dc2ff812138630ddbd
2013-08-15 20:35:35 -07:00
Jamie Lennox
d454676cf8 Extract basic request call
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
2013-08-12 14:19:23 +10:00
Dirk Mueller
ad73bfd2c7 Fix and enable gating on H403
Only a few occurrences of "multiline docstrings
should end on a new line."

Change-Id: I3fb4591259b1e7c8202365cbadc8967a1639254f
2013-07-13 00:45:58 +02:00
Dirk Mueller
f2ad113d1c Fix and enable gating on H402
Docstring summaries need punctuation.

Change-Id: I1b740c13d5fedf9a625ca0807c908f651ee08406
2013-07-12 09:36:07 +02:00
Dirk Mueller
fe8f9023ac Fix and enable H401
Remove leading spaces from doc comments.

Change-Id: I75b055c0d64dda478c63839d44158e301900107f
2013-06-27 01:28:30 +02:00
Kannan Manickam
d10218ff29 Added Conflict Exception to the exception code map
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
2013-05-07 10:56:59 +05:30
Jenkins
acdba5ee52 Merge "Add name arguments to keystone command." 2013-02-13 08:27:39 +00:00
Lin Hua Cheng
382441a9f1 Treat HTTP code 400 and above as error.
Fixes bug 1116559.

Change-Id: I4b12176599686f7e545b63c8e54cf9da6a1f963e
2013-02-05 11:30:27 -08:00
Ken'ichi Ohmichi
9351665062 Add name arguments to keystone command.
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
2013-01-17 18:11:27 +09:00
Dean Troyer
51dc6a0cef Use requests module for HTTP/HTTPS
* 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
2012-12-18 15:30:43 -06:00
Dolph Mathews
1b7eca8349 Merge remote-tracking branch 'origin/feature/keystone-v3' into HEAD
Conflicts:
	tests/v2_0/test_tenants.py

Change-Id: I37037e60210edd574da86b1dc07aa73e6761e338
2012-10-30 22:22:17 +00:00
Gabriel Hurley
0dfc69806d Don't log an exception for an expected empty catalog.
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
2012-10-23 11:27:43 -07:00
Dolph Mathews
46360085eb v3 Domain/Project role grants
Change-Id: Idbe0702b42603d6f9f133c9f1855ea9b4f222066
2012-10-09 22:58:29 +00:00
Bhuvan Arumugam
15d134d130 Handle "503 Service Unavailable" exception.
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
2012-09-24 19:21:58 +00:00
Joe Heck
52b392281e pep8 1.1 changes and updates
Change-Id: I8bc3582bb3f35a3d841bb1e8c03b62ba61ff92d7
2012-06-01 18:07:26 -07:00
Gabriel Hurley
6c164d2fe0 Improved error message when unable to communicate with keystone. 2011-12-07 13:05:13 -08:00
Gabriel Hurley
0c2a521974 Improved logging/error messages. 2011-11-17 14:25:04 -08:00
Gabriel Hurley
17f6b83ee6 Initial commit. 2011-10-25 16:50:08 -07:00