34 Commits

Author SHA1 Message Date
Jenkins
873bed99a8 Merge "Fix the failure of fetching the version in cinder endpoint" 2013-10-14 20:00:40 +00:00
Chuck Short
b0b8afaf55 python3: Refactor dict for python2/python3 compat
Python3 changed the behavior of dict.keys such that it is now
returns a dict_keys object, which is iterable but not indexable.
You can get the python2 result back with an explicit call to list.

Refactor list(*.keys()) so that it just uses list().

Change-Id: Ib2e9646ac967e9bd7cc4f47e2099f5d1358808a9
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-10-11 09:04:49 -04:00
jenny-shieh
f96dcd714e Fix the failure of fetching the version in cinder endpoint
To search for verion in cinder endpoint string, instead of using
hard code position

Implements: search for verion in cinder endpoint string
Closes-Bug: #1227307
Change-Id: Ie38806ad995e6fd49155f448abf9b2ef43f24a0e
2013-10-09 12:05:53 -05:00
ZhiQiang Fan
5ad95e9fd2 Replace OpenStack LLC with OpenStack Foundation
NOTE:
* openstack/common/* should be synced from oslo, so i leave them
untouched.
* add (c) symbol for related lines, leave others untouched.

Change-Id: I46a87c7f248d3468b1fdf5661411962faf2fb875
Fixes-Bug: #1214176
2013-09-28 23:13:54 +08:00
Jenkins
2f5c937d4c Merge "Add timeout parameter in requests" 2013-08-14 06:49:45 +00:00
Christian Berendt
c95e59f510 convert third-party exception to ConnectionError
fixes bug #1207635

Change-Id: I37da522e812286e72706409b8a6d4652515f720f
2013-08-06 12:11:24 +02:00
Yaguang Tang
fd409626fa Add timeout parameter in requests
Fix bug #1207260

Change-Id: I0f57a9b27c2da2521adb6aebfe3fa072c6b56808
2013-08-01 18:26:01 +08:00
John Griffith
3d30126e93 Revert "Use exceptions from oslo"
This reverts commit a7cce08eab5e2e42275b84bd56127bd09b00f5bf

Change-Id: I6c0047adbc33d0d6b5890f11853974578c36c78c
2013-07-15 10:30:05 -06:00
Alessio Ababilov
a7cce08eab Use exceptions from oslo
These exceptions can be used in novaclient, keystoneclient,
glanceclient, and other client projects.

Partially implements: blueprint common-client-library

Change-Id: I43918316622b1c1d722872fe30199db6a3a7bb76
2013-07-01 11:55:31 +03:00
Jenkins
dcc2f67bee Merge "Connectivity between the endpoint version and OS_VOLUME_API_VERSION." 2013-06-25 16:29:09 +00:00
Anastasia Latynskaya
6adda93c9d Connectivity between the endpoint version and OS_VOLUME_API_VERSION.
Adds functionality which allows user to work with
that cinder API version which is the same as
the endpoint version.

Fixes: bug #1169455

Change-Id: I9bb46e602d15856d2da502a6ac2b6c25e76f4fa3
2013-06-25 13:01:33 +00:00
Chuck Short
3044671b36 python3: Fix traceback while running tests
The testsuite is full of the following:

TypeError: 'dict_keys' object does not support indexing

This is due to the fact in python3 dict methods dict.keys(),
dict.items() and dict.values() return “views” instead of lists.

Change-Id: Ifa5383e6485fdbabf363fd1442877b2452346c1c
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-06-19 20:52:22 -05:00
Jenkins
9ab7cdcef9 Merge "python3: Basic python3 compatibility." 2013-06-12 16:39:22 +00:00
Chuck Short
b4ea550ba7 python3: fix imports compatibility
Python3 reorganized the standard library and moved several functions
to different modules. Six provides a consistent interface
to them through the fake six.moves module.

However, the urlparse, urllib2, etc modules have been combined
into one module which Six does not support so do it the old
fashioned way.

Change-Id: Ieb7cc7ee2a4a97807873cfe2fc3fa0a5cf3c3980
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-06-12 08:32:19 -05:00
Chuck Short
4b1cdab2fe python3: Basic python3 compatibility.
Basic python3 compatibilty.

Change-Id: I4388f5956cf397f8e33d20085aae6c6a728dbbda
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-06-12 07:59:44 -05:00
Dirk Mueller
7359c976d1 Start Gating on Pyflakes and Hacking
Instead of globally ignoring Pyflakes and Hacking
warnings, only blacklist those that occur frequently
and fix the others. Start gating on those checks.

Change-Id: Ice032c16d445ef08ef018bcdc5c221ab3c323755
2013-06-09 13:29:23 +02:00
Nicolas Simonds
2a446c5b6b Only add logging handlers if there currently aren't any
This corrects an odd problem where Horizon would stand up multiple
client objects, which would cause duplicate/triplicate/dozens of
repeated log lines in its log files, due to multiple identical
handlers being added to the logging object

Fixes Bug 1182678

Change-Id: I198f3ecbb687bff69a06a166574b998cce54f2ac
2013-05-21 16:19:38 -07:00
Chuck Short
2ed5cdcb5f Add license information.
Several files were missing the license issue, so simply
add them.

Change-Id: I866ec03096a72fe8ae7d776e2ffe040379ec5bc6
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-05-09 10:49:35 -05:00
Jenkins
c5f542fd5a Merge "Fix X-Auth_Token -> X-Auth-Token header name" 2013-04-07 10:37:24 +00:00
Eric Harney
5e4a985246 Remove unused "import sys"
Cleaning up with pyflakes.

Change-Id: I24878f1bb1693af13b2a7f0f7d6fe455f8747e91
2013-04-04 16:46:55 -04:00
Eric Harney
952970acbd Fix X-Auth_Token -> X-Auth-Token header name
Fixes bug 1163546

Change-Id: Idb2c5f23a1c57676984ffa33f64d27c461b0de15
2013-04-04 10:36:48 -04:00
Cory Stone
f2ac10f282 Debug output the http body
Output the kwargs[data] instead of kwargs[body] which was deleted.

Change-Id: I233e37cceb7079ec78b9bde093967dea9ad94441
Fixes: bug #1155655
2013-03-15 10:20:36 -05:00
Ollie Leahy
458ff24513 Fix typo breaking --debug option to cinder client
Fixes LP bug #1130730

Change-Id: Ia105e8a561b8d45c60e9a3c6ed46a953cc6df96f
2013-02-20 15:49:52 +00:00
Mike Perez
636ec5eccd adding v2 support to cinderclient
This will allow the cinderclient to speak to the v2 rest api if it's
enabled in the cinder config. Includes additional v2 tests as well.

blueprint cinderclient-v2-support

Change-Id: I004134d9f528a6eadefdaa89eb48087bcae2691f
2013-02-13 00:58:17 -08:00
Chuck Short
8d43cd9c01 Allow requests 0.8 and greater
Bump up version requirements for requests to standardize
on version >= 0.8 so it doesnt create conflict with other
openstack projects.

Change-Id: I1ed9b3bd6bdbbbb451298a3c397e6e7a06c0cabd
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-02-11 13:00:48 -06:00
Dean Troyer
82e47d0866 Use requests module for HTTP/HTTPS
* Implement correct certificate verification
* Add --os-cacert
* Rework tests for requests

Pinned requests module to < 1.0 as 1.0.2 is now current in pipi
as of 17Dec2012.

Blueprint: tls-verify

Change-Id: I71066ff7297f3b70c08b7ae1c8ae8b6a1b82bbae
2012-12-18 13:58:05 -06:00
Dean Troyer
d3603535d2 Port some additional logging changes from novaclient
* Allows capture of timestamps prior to and after request for timing
  https://review.openstack.org/11519
* Add -X to DELETE and PUT in debug mode
  https://review.openstack.org/12069
* Show request body in curl command
  https://review.openstack.org/12203

Change-Id: I0d87ab6b3c2b35ff843323cb818915e03993a844
2012-12-13 16:44:07 -06:00
Dean Troyer
e30724df5b Bring back the output from client.http_log()
Ported from novaclient https://review.openstack.org/9241
Support CINDERCLIENT_DEBUG as synonym for --debug

Change-Id: Ic03b9e7d84c8db14f6e193ca2b478fd0d70d1299
2012-12-13 15:56:00 -06:00
Cory Stone
112bd60d4e Add retries to cinderclient.
HTTPClient now supports a retries argument. It will reissue requests
for any 5xx or socket (400 with n/a) errors. This retry loop was
"inspired" by swiftclient's loop. It reauths one extra time if
necessary.  It uses backoff times of 1, 2, 4... seconds.

The default is 0 retries. It is also exposed to the shell as well with
a --retries arg.

Change-Id: I67bed02d65155f4a4d5d879bb233f56cc78849fa
2012-11-07 11:11:54 -06:00
John Griffith
dcbebd7b78 Revert "Add retries to cinderclient."
This reverts commit 3b1eda3b3bb6678e9c9ec3e783e3e12b0c42f0a4
2012-11-02 22:17:03 +00:00
Cory Stone
3b1eda3b3b Add retries to cinderclient.
HTTPClient now supports a retries argument. It will reissue requests
for any 5xx or socket (400 with n/a) errors. This retry loop was
"inspired" by swiftclient's loop. It reauths one time if necessary.
It uses backoff times of 1, 2, 4... seconds.

The default is 0 retries. It is also exposed to the shell as well with
a --retries arg.

Change-Id: I75d9a13d6c4ba16a5da13d4bf5cad78a777d67d7
2012-11-01 14:42:09 -05:00
Clay Gerrard
2313ddfc8c add tenant_id and make projectid optional
Add a new optional tenant_id keyword argument to the client classes
cinderclient.client.HTTPClient and cinderclient.v1.client.Client to
support authentication with tenant_id instead of projectid (which is
acctually used as "tenantName" in the auth request body).

Keystone can provide tokens without specifiying the tenant in any form,
but a tenantName _or_ tenantId is required to generate the catalog (the
keystone service code seems to prefer tenantName if both are specified).

When using cinderclient programatically, it may be more convienent,
depending on the context to authenticate with out specificying the
tenant, or by tenant_id instead of tenant_name.  Either way it's
impractial to make the requirement in the client for projectid
(tenantName) if the auth system has no such limitation.

The new client signature is backwards compatible.  There is no change in
behavior for the shell client.

Change-Id: I0c1bdbdabd9acc29133a48a798750323011f1f18
2012-09-11 12:38:09 -05:00
John Griffith
93f9fa75fa Set pep8 version to 1.1 in test_requires
* Fixes bug 1007520
* Changes in pep8 cause new failures

Change-Id: Ie678f01a5008b0df6ef43a360b599890cab40776
2012-06-15 13:56:39 -06:00
Jenkins
471704df64 Initial split from python-novaclient. 2012-05-21 16:32:35 -04:00