summaryrefslogtreecommitdiff
path: root/cinderclient/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Add auth_plugin support to cinderclientCory Stone2014-02-141-0/+10
| | | | | | | | | | | 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
* Add quota-usage commandSeif Lotfy2013-10-031-1/+4
| | | | | | | Added a new command quota-usage to allow querying the usage of the quota for a given tenant Change-Id: I720e6df94f9fedbb8b6385bd1707600542aaea08
* 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 volume name argumentsKen'ichi Ohmichi2013-09-181-0/+5
| | | | | | | | | | | | This patch adds volume name arguments to the following subcommands: * snapshot-create * backup-create * backup-restore * transfer-create Fixes bug #1220590 Change-Id: Ib0ff6e62d45abb14fa8c7313511ef6f72befe0d5
* Remove locals() from cinder client code baseMike Perez2013-07-311-2/+6
| | | | | | Hacking file now disallows locals() usage. Change-Id: I5049c718c2706d606c12913ae0b33a0fb3263542
* 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
* python3: Strutils is not neededChuck Short2013-06-221-6/+17
| | | | | | | | | 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-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>
* python3: Fix unicode stringsChuck Short2013-06-131-2/+2
| | | | | | | | | Python3 enforces the distinction between byte strings and text strings more rigorously than python2. So use six.text_type where approiate. Change-Id: I46b3f5fe1f990fc1b7a3ee32904d608b070fc4c3 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* python3: Basic python3 compatibility.Chuck Short2013-06-121-2/+4
| | | | | | | Basic python3 compatibilty. Change-Id: I4388f5956cf397f8e33d20085aae6c6a728dbbda Signed-off-by: Chuck Short <chuck.short@canonical.com>
* python3: compatibility for iteritems and iterkeysChuck Short2013-06-111-1/+2
| | | | | | | | | | | | | | Use six to allow python2/pyton3 for iteritems and iterkeys. six.iteriems() replaces dictionary.iteritems() (python2) and dictionary.iterms() (python3) six.iterkeys() replaces dictionary.iterkeys (python2) and dictionary.keys() (python3) Change-Id: I26c80b78a7dedf3aa32eedf01a83ff6d1e592ba7 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Allow generator as input to utils.print_list.Hugh Saunders2013-05-151-1/+1
| | | | | | | | | | Once the table is built, the length of the prettytable's internal array is checked rather than re-iterrating over the input. Adds tests for utils.print_list with list and generator input. Change-Id: I4c0bd08bf0c943de42ad90d255a2d831c2e98828 Fixes: bug #1180059
* Add license information.Chuck Short2013-05-091-0/+15
| | | | | | | | Several files were missing the license issue, so simply add them. Change-Id: I866ec03096a72fe8ae7d776e2ffe040379ec5bc6 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Don't print the empty table on list operations.John Griffith2013-04-111-1/+2
| | | | | | | | | | | | Changes to strutils.safe_encode cause the empty table to be printed out when no objects are actually retrieved. This patch just adds a check of the object list length before calling strutils.safe_encode, if the length is NOT > 0 we just return like we used to. Change-Id: I57930b5210c975baa7c4510fcf82b17157e17788
* Decodes input and encodes output1.0.3Flaper Fesp2013-03-291-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix support for Unicode volume namesEric Harney2012-10-231-6/+14
| | | | | | | | | | | | | It is possible to create a Unicode volume from the command line, but it cannot be manipulated by name for operations such as delete. This is because the find_resource function tries to match the Unicode string to a regular byte string, and a UnicodeWarning is issued, failing the match. Fix by decoding the Unicode name when trying to match. Fixes bug 1065275. Change-Id: I8e19a78bbc1ccb503ccd39dc3b904fc4f6f77858
* Initial split from python-novaclient.0.0Jenkins2012-05-211-0/+261