This allows a user to call reset-state or snapshot-reset-state on a
list of objects. The behavior is modeled after a similar change to
delete multiple volumes.
$ cinder reset-state good_volume good_volume_2
<no output>
Error behavior is as follows:
One success/one failure:
$ cinder reset-state good_volume asdf
Reset state for volume asdf failed: No volume with a name or ID of 'asdf' exists.
One failure:
$ cinder reset-state asdf
ERROR: Reset state for volume asdf failed: No volume with a name or ID of 'asdf' exists.
Two failures:
$ cinder reset-state asdf qwert
Reset state for volume asdf failed: No volume with a name or ID of 'asdf' exists.
Reset state for volume qwert failed: No volume with a name or ID of 'qwert' exists.
ERROR: Unable to reset the state for any of the specified volumes.
Related-Bug: 1241941
Closes-Bug: 1256069
Change-Id: Id0a36fb7de0d69be0dac98ea04e4708775250b7a
Since the method base.ManagerWithFind.findall has been modified by
adding the search_opts for all tenants support, the parameter
search_opts should also be added to all the manager classes, which
can be called whithin this method. volumetypemanager does not have
this parameter for its method list(). Adding search_opts will resolve
this issue.
Closes-Bug: #1252665
Change-Id: I526500625f1b5483cb5d88ea15e6ac8485a66ae3
Make sure calls are made to delete both volumes. Also removed redundant
fields in v1 fake volume.
Closes-Bug: #1253142
Change-Id: I51078041c6d765f28edb155d44928286ee2b0dd6
Change string representation of VolumeBackupsRestore to use
volume_id rather than non-existent VolumeBackupsRestore id.
Change-Id: I7b585d0de9b3b0511e7fd1a70b214090a17dfa93
Closes-Bug: #1255488
Add new section called "MASTER" to the release notes, where all patches
that implement blueprints or fix bugs should update the list. This list
will be used for the release notes when a new version is released.
Change-Id: If842bfbb85851fb7a9e22259423da204f4c308f4
Update prior to push 1.0.7 to PyPi.
Includes changes/updates to doc/source/index and
adds link to README.rst
Change-Id: I666f3e6004885db7a688abdac88fa1154d83f8c9
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
Adding volume readonly-mode-update interface to shell and client object
(v1 and v2) to allow end user update volume read-only access mode flag.
blueprint read-only-volumes
Related-Id: I4c84614d6541d5f7c358abadb957da7b8c3d9c48
Change-Id: I2d587f301a21c0d42b8940465862da25a70ed5a8
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
"nova delete" can delete multiple servers in one request but
"cinder delete" can only delete one volume in one request, it is
better to enhance cinder client to support remove multiple volumes
in one request.
Change-Id: I6a63aa3d7e4c152ae5e45bf2b36d862bdcd6df33
Closes-Bug: #1241941
Adding mode argument to volume manager attach function.
Allow Nova using read-write or read-only mode to attach a volume to an
instance.
blueprint read-only-volumes
Change-Id: Ib20c7802304d83f4aafef522171ebd47f672d883
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
This patch deprecates the --volume-id arg of backup-restore
when using the v2 api and adds (preferred) --volume arg.
Both args are still usable but the former is now listed as
"Deprecated" in the help message.
Change-Id: I2575d93041b26f971c59bc04828b356556617b62
Fixes: bug 1242816
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
Added below CLIs:-
1. Set or Delete metadata of a snapshot
2. Show metadata of a snapshot
3. Show metadata of a volume
4. Update all metadata of volume
5. Update all metadata of snapshot
Implements blueprint: add-metadata-cli
Change-Id: Ic2b5f3fce6104d1756879718f666a42549458ad3
In Python 3.3, hash randomization is enabled by default. It causes the
iteration order of dicts and sets to be unpredictable and differ
across Python runs.
Sort the metadata.keys() in reverse order to keep the test cases as is.
Change-Id: I233ada4dae4e9c0bc97bf8fd7d912a0eff9dd5b8
Signed-off-by: Chuck Short <chuck.short@canonical.com>
In Python 3.3, hash randomization is enabled by default. It causes the
iteration order of dicts and sets to be unpredictable and differ across
Python runs.
In the test case, the fixed expecting string will not match the test
result, it is relying on the dict order.
This change transforms the input dict to a sequence of two-element list,
with fixed order, and update the related expecitng string in test case.
Change-Id: I60d7bb3c4f940b76460ad5c417a1807915e0418e
Signed-off-by: Chuck Short <chuck.short@canonical.com>
In Python 3, hash randomization is enabled by default. It causes the
iteration order of dicts and sets to be unpredictable and differ across
Python runs.
Sort the list and update the expecting result.
Change-Id: Iead7ca8f45b035abd78f0b25865b5f7e1b9f3294
Signed-off-by: Chuck Short <chuck.short@canonical.com>
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>
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
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