summaryrefslogtreecommitdiff
path: root/cinderclient/client.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant statement and refactorLin Yang2015-07-081-5/+3
| | | | | | | | | | 1. Remove redundant pass-statement in except-block. 2. Define "body = None" before if-block to get rid of body-statement both in except-block and else-case. 3. Acknowledge error occurred instead of silently squashing it. Change-Id: I31e17827b40e7a15d88ecacf1fdb2abbbe2da5c0 Signed-off-by: Lin Yang <lin.a.yang@intel.com>
* Merge "Add set_management_url to cinderclient.client"Jenkins2015-07-071-0/+3
|\
| * Add set_management_url to cinderclient.clientMichal Dulko2015-06-251-0/+3
| | | | | | | | | | | | | | | | | | set_management_url was used in authenticate method but wasn't defined in the HTTPClient. This commit implements missing method and adds regression unit tests. Change-Id: I605a5d1bcf6cc2dc5720820d8a8122dd17089ffa Closes-Bug: 1418580
* | Revert "Enable version discovery"Mike Perez2015-07-021-25/+4
|/ | | | | | | | | | | | | | | This reverts commit ae03d2a721bd9acb61805ce792a27fb7cf88e5cd. Cases where a deployment is using a proxy, Cinder servers won't return the expected publicURL, and instead gives an internal URL that the client can't use. Commit 2eb25ab8803214cb3beb5d8fe3efbf70a462c414 in Cinder introduces the public_endpoint config option, but not everyone is expected to be running that later of a version to take advantage of this. Closes-Bug: #1464160 Change-Id: I61228c1e8630b958c792be077674b48fbdb83135
* Add version removal rule to stop discovery warningMike Perez2015-04-291-0/+8
| | | | | | | | | | | Cinder recently added version discovery leveraging Keystone Client. For cases where the service catalog still contains version numbers, this can result in Keystone attempting to do discovery at the base url with the version number and giving warnings. This will set a version removal rule so Keystone can find the correct base url. Change-Id: I71432468fea8bf1e50f180ab7f6dd69ee9aaa7e6 Closes-Bug: #1448244
* Enable version discoveryMike Perez2015-04-201-4/+25
| | | | | | | | | | | | | The service catalog can now have the cinder endpoint x.x.x.x:8776 with service_type volume, without needing to specify a version in the endpoint. Keystone will do discovery of the root / GET of the Cinder API to discover the versions that can be talked to. This also provides backwards compatibility for the previous solution of having v1 enabled on service_type volume and v2 on service_type volumev2. Change-Id: Id0347f8370dbc8fd7fa8096cd5859e10b0c5d67c
* Allow cinderclient to handle exception responsetpatil2015-03-311-1/+10
| | | | | | | | | | | | | | | | | For all cinder commands, the error message returned by the cinder service is gobbled by keystoneclient as raise_exc is enabled by default and it doesn't have the knowledge of how to interpret exception returned by the cinder service correctly. Set raise_exc to False explicitly in request method of cinderclient and pass it to the keystoneclient session request method so that keystoneclient raises exception only when the exception is raised by the keystone server else cinderclient should interpret the exception returned by the cinder service. Closes-Bug: 1431693 Closes-Bug: 1428764 Change-Id: I1160a2c998919b669c39a4b739e83f5bd9d8d235
* Merge "Don't use sessions if third party plugin is used"Jenkins2015-02-031-1/+2
|\
| * Don't use sessions if third party plugin is usedRobert Myers2014-12-091-1/+2
| | | | | | | | | | | | | | | | If an auth_plugin is used do not try to load the session from the default keystone providers. Change-Id: If2a87e23cabde006833de70e5c7aa066d95dbf50 Closes-Bug: #1380729
* | Leverage openstack.common.importutils import_classAaron Rosen2015-01-121-2/+1
| | | | | | | | | | | | | | | | This patch drops the import_class method from utils and instead leverages the one in openstack.common.importutils. Change-Id: I9f740b9941d477776597c4c4ab88a65a39fb4fb8 Closes-bug: 1365273
* | Merge "Fix incorrect variable name"Jenkins2015-01-061-1/+1
|\ \ | |/ |/|
| * Fix incorrect variable nameJamie Lennox2014-10-271-1/+1
| | | | | | | | | | | | | | | | valid_versions does not exist here, it is obviously supposed to mean _VALID_VERSIONS. Closes-Bug: #1386232 Change-Id: I477baa7642feba72f80d884d6183512185b02cf1
* | Merge "client HTTPClient __init__ fails if auth_url None"Jenkins2014-12-021-1/+1
|\ \
| * | client HTTPClient __init__ fails if auth_url NoneBill Arnold2014-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initializer for the python-cinderclient HTTPClient class fails if passed a None for an auth_url. This patch modifies the inializer to not call rstrip if auth_url is None, matching the initalizers in python-novaclient and python-neutronclient Change-Id: I19dd6911816639a0e0d6175ba910e9777a4b5981 Closes-bug: #1358926
* | | Merge "Use newer features from keystoneclient"Jenkins2014-12-021-28/+4
|\ \ \
| * | | Use newer features from keystoneclientJamie Lennox2014-12-011-28/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a number of functions that were implemented in keystoneclient in response to needs from cinder and other clients. Now that these were released in 0.11 cinderclient should make use of them rather than keep its own versions. Change-Id: I6444fc5bfd2d0505f9a7eb2c6068ab945ae5bb9b
* | | | Add the parameter bypass_url to the cinder clientVincent Hou2014-12-011-4/+15
|/ / / | | | | | | | | | | | | | | | | | | | | | If the bypass_url is specified in the http client, there is no need to get it from Keystone. Change-Id: I891849f77ad2ba98a83c993b401121216c8cfff6 closes-bug: #1350702
* | | cinderclient does not retry with TimeoutExceptionChristine Wang2014-10-241-0/+4
| |/ |/| | | | | | | | | | | | | | | Added retry support when encounter requests.exceptions.Timeout during HTTP request. Closes-Bug: #1379505 Change-Id: I6253a109c3a76dd2f15c96a349da68936f9bfff4
* | Add profiling support to cinderclientBoris Pavlovic2014-10-081-0/+6
|/ | | | | | | | | | | | | | | | | | | | To be able to create profiling traces for Cinder, client should be able to send special HTTP header that contains trace info. This patch is as well important to be able to make cross project traces. (Typical case nova calls cinder via python client, if profiler is initialized in nova, cinder client will add extra header, that will be parsed by special osprofiler middleware in cinder api) Don't worry no security issue here, trace information is signed by HMAC key that is setted in api-paste.ini. So only person that knows HMAC key is able to send proper header. Main patch (in Cinder) is: https://review.openstack.org/#/c/103415/ Change-Id: I53bb1b92e62841a02f941bdafaed7f8ed5db7ce1
* Use adapter from keystoneclientJamie Lennox2014-09-021-130/+96
| | | | | | | | | The keystoneclient provides an adapter which maintains the client state around the session. We should re-use this rather than copy it and it also means we will get new adapter functions and parameters as they become available. Change-Id: I05c0d650dcdd69f7e77a06563d735efe521a41ae
* Merge "Change "Connection refused" to "Connection error""Jenkins2014-08-031-2/+1
|\
| * Change "Connection refused" to "Connection error"Eric Harney2014-07-241-2/+1
| | | | | | | | | | | | | | | | | | The python-requests documentation indicates that the ConnectionError exception can be raised for reasons other than "connection refused". Let's just say "error" rather than implying the wrong type of failure. Change-Id: I2205e27c7c68164db430cdfdc71b57b3002b24be
* | Merge "Mask passwords in client debug output"Jenkins2014-08-021-1/+6
|\ \
| * | Mask passwords in client debug outputJay S. Bryant2014-07-301-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change looks for the use of 'password' in the data that is sent and uses mask_password() to remove the actual password text. This change will prevent debug output that is being saved from saving passwords. A test case is added to verify that password output is being removed. Change-Id: I93bde838ea21101df08c0e824d9f9457ed2ad077 Closes-Bug: 1341735
* | | Move debug logging to shellJamie Lennox2014-07-291-6/+0
| |/ |/| | | | | | | | | | | | | Adding channels to a logger is not the responsibility of a library. This sort of thing should be handled by an application so move the logging over to the shell. Change-Id: Ie11571d428913eba1aae5aa42a6e925228ba6808
* | Retry when connection to cinder is refusedXu Chen2014-07-241-2/+3
|/ | | | | | | | | | | | | | Currently, cinder client does not retry when connections to cinder service is refused. There are many legitimate scenarios under which retry should be attempted: 1) cinder service being restarted; 2) cinder service is running on multiple API nodes behind a LB, which might be temporarily overwhelmed or being maintained. In any scenario, retry with a backoff timer does not seem to hurt. Change-Id: I3c290c59fa67262c4a3473815b4380ee39e24332 Closes-Bug: 1347843
* Fix version discovery and auth_pluginsHaneef Ali2014-07-011-24/+26
| | | | | | | | | | V3Client support added version discovery and session supports. Most of the external auth system doesn't support this. This fix bypasses version discovery if the idenity service doesn't support that. Session is used only if no external auth plugin is used Change-Id: Ia84a2ad45940d35c5ef740727f5f7477c72ea9d4 Closes-Bug: #1333961
* Merge "Use region_name in service catalog"Jenkins2014-06-301-2/+1
|\
| * Use region_name in service catalogJamie Lennox2014-04-041-2/+1
| | | | | | | | | | | | | | Using attr and filter is no longer necessary. We provide a region_name filter directly that works with both v2 and v3 service catalogs. Change-Id: I67b50fcaa5e4df5c2bb7b2966b5ef2040e6286e7
* | Added support for keystone v3clienthaneef ali2014-06-171-17/+170
| | | | | | | | Change-Id: I7bbc74c9e73f36f942f5800a7af0da717da0bc64
* | Merge "Add auth_plugin support to cinderclient"Jenkins2014-04-171-5/+24
|\ \ | |/ |/|
| * Add auth_plugin support to cinderclientCory Stone2014-02-141-5/+24
| | | | | | | | | | | | | | | | | | | | | | With CINDER_RAX_AUTH being rightfully removed, cinderclient is no longer compatible with Rackspace/any non-keystone auth. To fix this, I stole auth_system/auth_plugin from novaclient's implementation. See https://review.openstack.org/#/c/23820/. Change-Id: If5f84003f868ef02bb7eb7da67cf62018602e8f0 Closes-Bug: 1280393
* | Import access module from keystoneclient to handle V3 endpointsShao Kai Li2014-03-031-7/+6
|/ | | | | | | | | | | | | | | | | * service_catalog.py will be used only by nova(cinder.py), it will be removed if nova uses access instead of service_catalog. Then service_catalog.py and test_service_catalog.py will be removed from cinderclient if necessary. * Some unit tests are modified. * Because of JSON format's modification, functions that process cinder credentials and cinder endpoints are changed. * Add dependency for keystoneclient in requirements.txt. Change-Id: Icf7badfdddcf5f55536d95db7242aff58aa34b6e Closes-Bug: #1263876 bp: service-catalog
* Remove RAX-specific auth in cinderclientSwapnil Kulkarni2014-01-251-15/+1
| | | | | Change-Id: Idd36694a322f467ba5e8c1f58bfac701bff8f3f8 Closes-Bug: #966329
* Merge "Fix the failure of fetching the version in cinder endpoint"Jenkins2013-10-141-6/+7
|\
| * Fix the failure of fetching the version in cinder endpointjenny-shieh2013-10-091-6/+7
| | | | | | | | | | | | | | | | | | 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
* | python3: Refactor dict for python2/python3 compatChuck Short2013-10-111-1/+1
|/ | | | | | | | | | | 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>
* Replace OpenStack LLC with OpenStack FoundationZhiQiang Fan2013-09-281-1/+1
| | | | | | | | | | 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
* Merge "Add timeout parameter in requests"Jenkins2013-08-141-0/+3
|\
| * Add timeout parameter in requestsYaguang Tang2013-08-011-0/+3
| | | | | | | | | | | | Fix bug #1207260 Change-Id: I0f57a9b27c2da2521adb6aebfe3fa072c6b56808
* | convert third-party exception to ConnectionErrorChristian Berendt2013-08-061-1/+2
|/ | | | | | fixes bug #1207635 Change-Id: I37da522e812286e72706409b8a6d4652515f720f
* Revert "Use exceptions from oslo"John Griffith2013-07-151-19/+16
| | | | | | This reverts commit a7cce08eab5e2e42275b84bd56127bd09b00f5bf Change-Id: I6c0047adbc33d0d6b5890f11853974578c36c78c
* Use exceptions from osloAlessio Ababilov2013-07-011-16/+19
| | | | | | | | | These exceptions can be used in novaclient, keystoneclient, glanceclient, and other client projects. Partially implements: blueprint common-client-library Change-Id: I43918316622b1c1d722872fe30199db6a3a7bb76
* Merge "Connectivity between the endpoint version and OS_VOLUME_API_VERSION."Jenkins2013-06-251-0/+11
|\
| * Connectivity between the endpoint version and OS_VOLUME_API_VERSION.Anastasia Latynskaya2013-06-251-0/+11
| | | | | | | | | | | | | | | | | | | | 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
* | python3: Fix traceback while running testsChuck Short2013-06-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge "python3: Basic python3 compatibility."Jenkins2013-06-121-3/+5
|\ \
| * | python3: Basic python3 compatibility.Chuck Short2013-06-121-3/+5
| | | | | | | | | | | | | | | | | | | | | Basic python3 compatibilty. Change-Id: I4388f5956cf397f8e33d20085aae6c6a728dbbda Signed-off-by: Chuck Short <chuck.short@canonical.com>
* | | python3: fix imports compatibilityChuck Short2013-06-121-1/+6
|/ / | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Start Gating on Pyflakes and HackingDirk Mueller2013-06-091-1/+2
|/ | | | | | | | 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