summaryrefslogtreecommitdiff
path: root/cinderclient/shell.py
Commit message (Collapse)AuthorAgeFilesLines
* Set default OS_VOLUME_API_VERSION to '2'Ivan Kolodyazhny2015-07-301-1/+1
| | | | | | | | Cinder API v1.1 is deprecated and will be removed. Switching to API v2 in cinderclient makes it works well with new API after API v1 will be removed. Change-Id: I639f4b54dc7e220e8e351113a4de1dff104b50a7
* Merge "Remove unnecessary check for tenant information"Jenkins2015-07-201-30/+36
|\
| * Remove unnecessary check for tenant informationIan Cordasco2015-07-081-30/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keystone v3 has changed the name of tenants to projects which means that OS_TENANT_NAME is meaningless in a cloud where v3 is the default authentication version. As such, if a user does not have OS_TENANT_NAME enabled, cinderclient will not work even though it has checks for v3 immediately below this check (and the same check replicated further below that). Removing this allows cinderclient to work with Keystone v3 without setting OS_TENANT_NAME unnecessarily. Further, the check for project information was incorrectly referring to project_domain_name and project_domain_id instead of os_project_domain_name and os_project_domain_id. Closes-bug: 1472636 Change-Id: Ifabb4a2aec070c00349e794364a71394feea99f1
* | Merge "Use shared shell arguments provided by Session"Jenkins2015-07-161-25/+4
|\ \ | |/ |/|
| * Use shared shell arguments provided by SessionMichal Dulko2015-06-251-25/+4
| | | | | | | | | | | | | | | | | | The cinderclient implemented it's own version of the CLI arguments that are now provided by keystoneclient's session object. This changeset converts cinder over to utilizing the shared argument registration. Closes-Bug: 1434105 Change-Id: I72b16aab909d72a47097434436093e616667634a
* | Revert "Enable version discovery"Mike Perez2015-07-021-75/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | cinderclient does not honor --os-region-name or ENV[OS_REGION_NAME]scottda2015-06-221-0/+4
|/ | | | | | | | When we use version discovery, we must pass in os-region-name for it to work. Change-Id: I82765f7a899d84283dd3a3672f6e151805c1c6fa Fixes: bug 1467628
* Merge "cinderclient deprecated endpoint_type needs dest="Jenkins2015-06-161-0/+1
|\
| * cinderclient deprecated endpoint_type needs dest=scottda2015-05-121-0/+1
| | | | | | | | | | | | | | | | Fix for https://bugs.launchpad.net/python-cinderclient/+bug/1453901 did not set dest=os_endpoint_type for synonym endpoint_type Change-Id: I98a8507f2369deff6a6f7f8f08271b169fe651ad Closes-Bug: 1454436
* | Merge "Avoid _get_keystone_session() if auth_plugin"Jenkins2015-06-021-2/+5
|\ \
| * | Avoid _get_keystone_session() if auth_pluginDerrick J. Wippler2015-05-071-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Avoid calling _get_keystone_session() if auth_plugin is provided by the user Closes-Bug: 1421433 Change-Id: I37a7139107c357caf1a25ac3d0a3457afade0f83
* | | Bump hacking to >=0.10.0,<0.11 to fix failure of gate pep8Tomoki Sekiyama2015-06-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pbr 1.0.1 released in 2015-05-19 requires the newer hacking module >=0.10.0,<0.11 than the versions specified in the test-requirement.txt file, which causes failure in gate-python-cinderclient-pep8. This patch bumps the pbr version in test-requirement.txt to make it consistent with requirements repository, and adds some fixups to avoid some new hacking rules. Change-Id: I7de6e04e30a475ec1c26224461faf0c708178a40 Closes-Bug: #1460774
* | | Merge "cinderclient no longer honors --endpoint-type"Jenkins2015-05-131-4/+4
|\ \ \ | |_|/ |/| |
| * | cinderclient no longer honors --endpoint-typescottda2015-05-121-4/+4
| |/ | | | | | | | | | | | | | | | | | | | | Commit for "Enable version discovery": ae03d2a721bd9acb61805ce792a27fb7cf88e5cd breaks CLI use of --endpoint-type. This is because we were using the default interface instead of checking to see if an endpoint_type is passed in. Change-Id: I412bb6b4bcb9bf10aa6118a2ed43e28cbd3ed236 Closes-Bug: 1454407
* | Add --os-endpoint-type to match other servicesscottda2015-05-121-7/+14
|/ | | | | | | | | | | Cinder uses the parameter '--endpoint-type' but other services (Glance, Nova, Swift) use '--os-endpoint-type'. (Neutron has deprecated 'endpoint-type' in favor or 'os-endpoint-type' as well. '--endpoint-type' should be deprecated and 'os-endpoint-type' should be added. Change-Id: I0ac6573be35c86b9f764a39f1e60486d2345f51b Closes-Bug: #1453901
* Enable version discoveryMike Perez2015-04-201-13/+72
| | | | | | | | | | | | | 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
* Merge "cinderclient accepts arguments after metadata without -- separator"Jenkins2015-03-161-0/+23
|\
| * cinderclient accepts arguments after metadata without -- separatorrajiv2015-03-101-0/+23
| | | | | | | | | | | | | | | | Added a function, which parse arguments and add -- separator after metadata subcommand Change-Id: I907eb89209d549dcdad361d88352491110eaadb9 Closes-Bug: #1379486
* | Add -d short option for --debugKallebe Monteiro2015-02-121-1/+1
|/ | | | | | | | | | A short option for --debug is a convenience. This commit adds the -d short option as a shortcut for --debug Glance already provides -d. Change-Id: Iefae6cee566f9c7d7375e89c3f8603f149e555ef Closes-Bug: #1421210
* Add the parameter bypass_url to the cinder clientVincent Hou2014-12-011-2/+14
| | | | | | | | 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
* Adds tty password entry for cinderclientJohn Trowbridge2014-10-241-5/+15
| | | | | | | | Added functionality from keystoneclient to fallback to the tty for password entry if no password is given via the environment or the --os-password option. Change-Id: If5b27cb8c67712860faa24d543ed48eaa542f28b Closes-Bug: 1357559
* Add profiling support to cinderclientBoris Pavlovic2014-10-081-0/+23
| | | | | | | | | | | | | | | | | | | | 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
* Enables debug mode for keystone session objectgit-harry2014-09-181-0/+3
| | | | | | | This fixes the lack of debug messages introduced by commit 84af49c. Change-Id: I7bf3e98c21f09bd4f3c2d5d3bc372f60d717c9d5 Closes-bug: #1370152
* Move debug logging to shellJamie Lennox2014-07-291-0/+9
| | | | | | | | 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
* Fix version discovery and auth_pluginsHaneef Ali2014-07-011-10/+37
| | | | | | | | | | 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
* Remove deprecated command-line argsMatt Fischer2014-06-261-58/+14
| | | | | | | Some command-line args were deprecated in Diablo and slated for removal in Folsom. They're being removed in Juno instead. Change-Id: I02339ba08c997fecca5a6639382360962e668bfd
* Added support for keystone v3clienthaneef ali2014-06-171-76/+322
| | | | Change-Id: I7bbc74c9e73f36f942f5800a7af0da717da0bc64
* Merge "Ambiguous option error should not appear if Arg is SUPPRESS"Jenkins2014-05-081-0/+23
|\
| * Ambiguous option error should not appear if Arg is SUPPRESSJuan Manuel Olle2014-04-161-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to backward compatibility there are arguments hidden. For example: --tenant-id and --tenant_id On those case the abbreviation mechanism if a user enter --tenant throw that there is an ambiguity but the helps only show --tenant-id as an optional argument. This change remove this ambiguity if one of them is hidden. Change-Id: I413f1ebafc68b3e02b5abadce1608e6d48207b01 Closes-Bug: #1252457
* | Update help strings for cinder clientDiane Fleming2014-04-231-49/+60
| | | | | | | | | | | | | | | | | | | | Make text consistent and clear. Add periods to end of sentences. Adjust test suite for change Closes-Bug: #1275881 Change-Id: I1dfde51636e8dc4b42e4c4810c27c1c4ac513d82
* | Add auth_plugin support to cinderclientCory Stone2014-02-141-10/+38
|/ | | | | | | | | | | 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
* Fix typo in cinderclienthuangtianhua2013-11-281-1/+1
| | | | | | | | | sematics --> semantics hypen-separated --> hyphen-separated typicaly --> typically Change-Id: I5df277ef7036082d0e4b079c23d41da809e5270f Closes-Bug: #1254587
* Override endpoint URL check for API versionJay S. Bryant2013-10-171-11/+39
| | | | | | | | | | | | | | | | | | | | | | get_volume_api_version_from_endpoint currently assumes that the management_url will always be in the format of http://<ip>:<port>/vX/<tenant_id>. Customers using a gateway, however, can get a mangement_url in a different form like https://<ip>:<port>/<resource>/vX/<tenant_id>. This causes the get_volume_api_version_from_endpoint to find the resource portion of the url when looking for the Volume API version which makes the cinder client unusable. To resolve this I have implemented an exception handler in the case that get_volume_api_version_from_endpoint fails. If the exception is thrown, I check for OS_VOLUME_API_VERSION in the environment and use the value of that environment variable, if it is set, to determine the API version to use. There are proposals to fix this via changes to keystone in future releases, but this provides a way for IaaS Gateway users to proceed with Havana. Change-Id: I8b978a6ecd87b81c6ae34938e37623ad1cc33994 Closes-Bug: 1233311
* Merge "python3: Refactor dict for python2/python3 compat"Jenkins2013-10-131-1/+1
|\
| * 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>
* | Fix DeprecationWarning when printing exceptionEric Harney2013-10-091-6/+1
|/ | | | | | | | | | | | | On Python 2.6, this results in an error like: /usr/lib/python2.6/site-packages/cinderclient/shell.py:524: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 message = e.message Should use the method from novaclient commit 8c4e145b92, which works well with python2 and python3. Change-Id: Ifbd78ad158ae87670bdee4e247469091efaa3260
* 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
* Add support for multiple cinder endpointsMike Perez2013-08-081-3/+3
| | | | | | | | | | | Before v1 and v2 were set to the same service_type, so you could only have one set at a time. This assumes the catalog is setup for v1 service_type 'volume' and v2 service_type 'volumev2'. For backwards compatibility, we will allow v2 to be setup with service_type 'volume' for existing installations. Change-Id: Ife6d2cdb12d894b84ea3b276767fb93d487355d5
* Revert "Use exceptions from oslo"John Griffith2013-07-151-1/+1
| | | | | | This reverts commit a7cce08eab5e2e42275b84bd56127bd09b00f5bf Change-Id: I6c0047adbc33d0d6b5890f11853974578c36c78c
* Use exceptions from osloAlessio Ababilov2013-07-011-1/+1
| | | | | | | | | 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/+9
|\
| * Connectivity between the endpoint version and OS_VOLUME_API_VERSION.Anastasia Latynskaya2013-06-251-0/+9
| | | | | | | | | | | | | | | | | | | | 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: Strutils is not neededChuck Short2013-06-221-2/+8
| | | | | | | | | | | | | | | | | | strutils is used to safely encode and decode unicode strings for python2.7. Since unicode strings are the default in python3, ignore the use of strutils when running with python3. Change-Id: I9a8e296b4f2153b1ef4302a7dcd797fbb4561c35 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* | python3: Fix traceback while running testsChuck Short2013-06-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | python3: Basic python3 compatibility.Chuck Short2013-06-121-4/+6
|/ | | | | | | Basic python3 compatibilty. Change-Id: I4388f5956cf397f8e33d20085aae6c6a728dbbda Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Merge "Minor typo/message fixes"Jenkins2013-04-091-1/+2
|\
| * Minor typo/message fixesEric Harney2013-04-081-1/+2
| | | | | | | | | | | | | | | | Correct it's -> its in force-delete message Print whole bash_completion message in "cinder help" Reformat some doc strings per PEP-0257 Change-Id: I013b849508beac5c9fe5c6f9d4cdfae54676c29c
* | Merge "Add OS_TENANT_ID as authentication option"Jenkins2013-04-051-10/+20
|\ \ | |/ |/|
| * Add OS_TENANT_ID as authentication optionLiam Kelleher2013-03-271-10/+20
| | | | | | | | | | | | bug 1160898 Change-Id: I8849ab8f552801b8a317cd0394251c2db1ba8e9a
* | Decodes input and encodes output1.0.3Flaper Fesp2013-03-291-2/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently cinderclient doesn't handle properly incoming and outgoing encode / decode process. As a solution for this, this patch implements a decoding process for all data incoming from the user side and encodes everything going out of the client, i.e: http requests, prints, etc. This patch introduces a new module (strutils.py) taken from oslo-incubator in order to use 2 of the functions present in it: About safe_(decode|encode): Both functions try to encode / decode the incoming text using the stdin encoding, fallback to python's default encoding if that returns None or to UTF-8 as the last option. In both functions only basestring objects are accepted and they both raise TypeError if an object of another type is passed. About the general cinderclient changes: In order to better support non-ASCII characters, it is a good practice to use unicode interanlly and encode everything that has to go out. This patch aims to do that and introduces this behaviour in the client. Testing: A good test (besides using tox) is to use cinder client with and without setting any locale (export LANG=). Fixes bug: 1130572 Change-Id: Idb7d06954c29e003f68a0c4aa0b80ecc7017cbc9