This patch added client handling and unit tests for volume type description:
* Added 2 client methods for volume type.
default: to get the default volume type
update: to upate an existing volume type to update description
* Added 2 new command-line operations.
type-update (adminitrator only)
type-default
* type-list should display description.
* type-create should have an option for entering the description.
The corresponding cinder APIs change volume-type-description:
https://review.openstack.org/#/c/131871/
Implements: blueprint volume-type-description
Change-Id: I2735d7050d90589d19f45e21096577febdcca8bb
Convert the function _list into a loop function, which can retrieve
the items from the next link till the limit or the end of items has
been reached. This works for v2 only.
So far, only volume list in v2 support limit. The limit parameter
work for volume list in v2 only, but other list can extend it in
future work.
Change-Id: I011f0ed1a4ab639f67db6cae580d978c0b44c1bb
closes-bug: #1342192
It's clear that we aren't testing against Python 2.4 (not
supported by dependencies like six) and no other client
projects have this, so we should drop it.
Change-Id: I14108964c0261d9144ced16cee7101d14ca7e644
Class Resource from oslo is equal to code from cinderclient.
In the process of unification of the clients code we should
reuse common functionality from Oslo.
Related to blueprint common-client-library-2
Change-Id: If39e49ff739d659d145725966192acf81975c90c
Currently, due to the way that resources are being retrieved by the
findall() function, an administrator can do a list, snapshot-list, etc.
with the --all_tenants option and see other tenants' resources. If the
admin then tries to delete the another tenants' resource by name, it fails
with a 'No <resource> with a name or ID of <name> exists.' error.
The solution to this is to change the call to the list() function in
findall() to set the all_tenants search option to 1. This causes the
admin to get a list of all the resources that they have access to back
when the search is done instead of just a list of their resources. The
delete by name is then possible. The server takes care of ensuring that
only resources that the user has access to are returned.
This will enable delete by name for all resources that use the find_resource
function.
Closes-bug: 1241682
Change-Id: I4e9957b66c11b7e1081f066d189cedc5a3cb2a6c
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>
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
These exceptions can be used in novaclient, keystoneclient,
glanceclient, and other client projects.
Partially implements: blueprint common-client-library
Change-Id: I43918316622b1c1d722872fe30199db6a3a7bb76
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>
Fix:
TypeError: Unicode-objects must be encoded before hashing
while running tests. This is due to the fact in python3 hashlib.md5
works with bytes and we are passing unicode strings.
Change-Id: I0adde942423af28572473030f6685e12cd8f7dae
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Use six.with_metaclass to create a new class with
a base class base and metaclass metaclass.
Change-Id: Id1e70f8cae0ac3dd075157f57d41a02b15e655f4
Signed-off-by: Chuck Short <chuck.short@canonical.com>
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>
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
ManagerWithFind requires list() method in its descendants.
Make it abstract and fix its improper descendants that do
not implement list() (QuotaSetManager and others).
Change-Id: I691ca389b5fea4c1bb36499a264b578fa825bbbf
Fixes: bug #1180393