69 Commits

Author SHA1 Message Date
Jenkins
31df452872 Merge "Fix python3 incompatible use of urlparse" 2013-11-22 19:18:47 +00:00
Jamie Lennox
e56ae0c41d Update the management url for every fetched token
management_url was originally set once and never changed so that when
specifying an endpoint it wasn't later overridden by the service
catalog. This behaviour would prevent the management_url from being
updated when the client was reauthenticated.

Change-Id: I2fa41e2ae1b853bbb254698cf94b9314eb0f0903
Closes-bug: 1252927
2013-11-20 12:40:13 +10:00
Clint Byrum
43e278c8be Fix python3 incompatible use of urlparse
Use six to make it work. While we're not yet able to gate
keystoneclient on py33, we still need keystoneclient to work when
keystoneclient is included in other libraries' test suites. This was
discovered while working on python3 for python-tuskarclient.

Note that together with I65c28896d1551fd537dd7774e87bc479a477a7ab
keystoneclient can be used safely in python-tuskarclient's py33 tests.

Closes-bug: #1239802

Change-Id: Ie6d31dc5fae7e63bb31a5192fa6765fe35dd026a
2013-11-14 22:33:43 -08:00
Kieran Spear
bede0a0eb6 Quote URL in curl output to handle query params
Copy and pasting the generated curl output into a shell doesn't
work when the URL includes an ampersand, as the URL isn't quoted.

Closes-Bug: #1249891
Change-Id: Ic3d7682a2c034e89c3367c858ea33510f8cbc7d4
2013-11-11 14:31:28 +11:00
Kieran Spear
6a865eab33 Fix curl debug output for requests with a body
Rather than output the request body as a separate line, make it part of
the example curl command using the -d option.

Partial-Bug: #1249891
Change-Id: Ie3fe4535f554333c67244a13c5698c025f000e7e
2013-11-11 14:31:18 +11:00
Kieran Spear
6454bc2894 Add --insecure to curl output if required
When the --insecure option is given, the curl command did not have
certificate verification turned off.

Partial-Bug: #1249891
Change-Id: Ia4f21d03f060bac0db51a79b89b0246b2ee3d041
2013-11-11 14:30:25 +11:00
David C Kennedy
9dd978817b Improved error message on connection failure
Added message from thrown error to message generated when httpclient connection fails

Closes-Bug: 1248257

Change-Id: Id47092f5775b97e8423e18c294f4e04872aa0b08
2013-11-06 14:16:42 +00:00
ZhiQiang Fan
0774d5aafa Replace OpenStack LLC with OpenStack Foundation
Some files still use trademark OpenStack LLC in header, which
should be changed to OpenStack Foundation.

NOTE: tools/install_venv.py is not touched, should sync with oslo

Change-Id: I01d4f6b64cf1a152c4e190407799ce7d53de845f
Fixes-Bug: #1214176
2013-10-17 01:19:01 +08:00
Chuck Short
b7b31bf646 python3: Make iteritems py3k compat
Use six.iteritems to replace dictionary.iteritems() on python2 or
dictionary.items() on python3.

Change-Id: I972f065414e22d287bd7e00ab2c6e754f17afb75
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-10-10 14:07:20 -04:00
Jenkins
ecc3d0794b Merge "Fix and enable gating on F811" 2013-08-30 21:04:00 +00:00
Jenkins
9edf7d0336 Merge "Add apiclient.exceptions hierarchy" 2013-08-30 21:01:00 +00:00
Jenkins
789f40d21e Merge "Use OSLO jsonutils instead of json module" 2013-08-30 02:24:42 +00:00
Morgan Fainberg
d21f73ab28 Fix and enable gating on F811
Fixes duplicate method definitions and enables gating on F811

Change-Id: Ic360e70d13da864b8b5c10fc5e731b3952b2d2e8
2013-08-29 22:08:26 +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
Jamie Lennox
6da9262b03 Use OSLO jsonutils instead of json module
For most things there is very little difference, but as we have a
jsonutils module we should probably be using it.

Change-Id: I406ea81bb56ad90cc9ff9b8b58b0d35b694dc802
2013-08-26 10:18:11 +10:00
Steven Hardy
2c5ac69c8a Initial Trusts support
Implements client support for the basic trusts API operations,
note this does not include support for the roles subpath operations,
support for those can be added in a subsequent patch.

Change-Id: I0c6ba12bad5cc8f3f10697d2a3dcf4f3be8c7ece
blueprint: delegation-impersonation-support
2013-08-20 23:16:46 +01: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
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
Jamie Lennox
b7c6f604e7 Rename client.py to httpclient.py
The discoverable entry point is to be client.Client however adding this
functionality to the current client.py is impossible as we end up with
circular dependencies.

This patch simply renames the current client.py to httpclient.py to make
future patches that will modify client.py more readable.

Required for: blueprint api-version-discovery

Change-Id: Ibcea03f6e1df0ae05329297166a8b8117fc3ce7b
2013-08-10 17:30:09 +10:00