293 Commits

Author SHA1 Message Date
Eric Harney
0e2bd33265 Reset-state and snapshot-reset-state for multiple objects
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
2013-12-04 08:58:19 -05:00
Vincent Hou
e64973f9a7 Add search_opts into the method list() for VolumeTypeManager
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
2013-12-03 11:59:19 +02:00
Jenkins
1aa375ae43 Merge "Add assert to delete multiple test" 2013-12-03 09:32:15 +00:00
Jenkins
15b10a0550 Merge "Update HACKING.rst with release note requirement" 2013-12-03 09:32:11 +00:00
Jenkins
37eeebe268 Merge "Fix string representation of VolumeBackupsRestore" 2013-11-30 23:01:20 +00:00
Avishay Traeger
c33dd1b842 Add assert to delete multiple test
Make sure calls are made to delete both volumes. Also removed redundant
fields in v1 fake volume.

Closes-Bug: #1253142
Change-Id: I51078041c6d765f28edb155d44928286ee2b0dd6
2013-11-28 11:30:49 +02:00
huangtianhua
5aaa68f09e Fix typo in cinderclient
sematics --> semantics
hypen-separated --> hyphen-separated
typicaly --> typically

Change-Id: I5df277ef7036082d0e4b079c23d41da809e5270f
Closes-Bug: #1254587
2013-11-28 09:28:05 +08:00
Stephen Mulcahy
3447532ba6 Fix string representation of VolumeBackupsRestore
Change string representation of VolumeBackupsRestore to use
volume_id rather than non-existent VolumeBackupsRestore id.

Change-Id: I7b585d0de9b3b0511e7fd1a70b214090a17dfa93
Closes-Bug: #1255488
2013-11-27 11:05:42 +00:00
wanghao
e8a0e6abdf Fix inappropriate comment for set_metadata
Fix inappropriate comment for the param of set_metadata

Change-Id: I01495f59b11ed88389b0e0f2f5fb34289f64dbac
Closes-Bug: 1254951
2013-11-26 08:07:16 +02:00
Jenkins
fb03281c9e Merge "Added support for running the tests under PyPy with tox" 2013-11-22 07:07:48 +00:00
Avishay Traeger
6050cfae7e Update HACKING.rst with release note requirement
New patches to python-cinderclient must now add an entry for release
notes.

Change-Id: Id7fe24f2cabf4145933e0babc6641d250165ce74
2013-11-20 17:57:21 +02:00
OpenStack Jenkins
6e214b2c03 Updated from global requirements
Change-Id: I80d6e02b5daaa0862e4b1f15d1bf3211dc0f359e
2013-11-15 12:57:43 -05:00
Christian Berendt
6844e54f13 change assertEquals to assertEqual
According to http://docs.python.org/2/library/unittest.html
assertEquals is a deprecated alias of assertEqual.

https://review.openstack.org/#/c/56652/ updates to a new version of
hacking that enforces H602. Turning that on requires this change to land
first.

Re-do of https://review.openstack.org/#/c/53510 since that is abandoned.

Change-Id: Ie621edc8770e2015df5712f77d4cf9679b02bd0f
2013-11-15 17:14:49 +00:00
Avishay Traeger
cd191d2eb3 Add index.rst section for patches merged to master
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
2013-11-14 19:30:46 +02:00
Joe Gordon
6296974b1a Update link in HACKING.rst and Make it DRYer
* Fix URL for global hacking doc, related to
  I579e7c889f3addc2cd40bce0c584bbc70bf435e2
* Remove section on locals, as its already in openstack-dev/hacking
  (http://git.openstack.org/cgit/openstack-dev/hacking/tree/doc/source/index.rst#n154)

Change-Id: If944b088f343404c5b90b02afe6f781dd1db914d
2013-11-11 11:01:57 -08:00
john-griffith
d21ed05b4e Update version and index.rst for push
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
2013-10-30 21:12:31 -06:00
Jenkins
ab72726857 Merge "Enable del of other tenants resources by name" 2013-10-30 21:37:27 +00:00
Avishay Traeger
bdd560b3c0 Fix py33 due to readonly and metadata patches
A couple recent merges broke py33 - this fixes it.

Change-Id: Iaab8a08aeb42c954f3ecff7da70003d1c4eead0d
2013-10-30 10:20:17 +02:00
Jay S. Bryant
8a6a291e03 Enable del of other tenants resources by name
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
2013-10-29 11:12:22 -05:00
Jenkins
e5ae2ff8d7 Merge "Adding volume readonly-mode-update interface to Cinder client" 2013-10-29 08:42:21 +00:00
Zhi Yan Liu
7ea6c8eb80 Adding volume readonly-mode-update interface to Cinder client
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>
2013-10-24 18:01:05 +08:00
Jenkins
f9e0a9a4a3 Merge "Addition of volume/snapshot_metadata CLI" 2013-10-27 14:21:47 +00:00
Jay Lau
4ce8e800c4 Enable "cinder delete" can delete multiple volumes in one request
"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
2013-10-25 22:58:51 -04:00
Zhi Yan Liu
f6f3254d8b Adding Read-Only volume attaching support to Cinder client
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>
2013-10-24 17:39:32 +08:00
Jenkins
7fa5bc3005 Merge "python3: sort dict for post_volumes_1234_action test" 2013-10-23 22:26:28 +00:00
Jenkins
bdac412d3e Merge "python3: align the order of parameters for urlencode()" 2013-10-23 22:26:26 +00:00
Edward Hope-Morley
6b998a9529 Deprecates --volume-id arg for v2 backup-restore
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
2013-10-23 09:26:19 -07:00
Jenkins
aa0583eaf4 Merge "Fixes broken v1 and v2 api backup-restore" 2013-10-22 11:13:53 +00:00
Jenkins
03acdc2462 Merge "Add quota-usage command" 2013-10-21 18:14:24 +00:00
Jay S. Bryant
84ea630be0 Override endpoint URL check for API version
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
2013-10-17 15:03:55 -05:00
Jenkins
342022b5cf Merge "python3: iteration order of dict is unpredictable" 2013-10-17 03:42:02 +00:00
Edward Hope-Morley
c4ae3dd7a5 Fixes broken v1 and v2 api backup-restore
Also adds unit tests.

Change-Id: I741889d49cffe46bf9165b266a62f2b328354e01
Fixes: bug 1240151
2013-10-15 19:47:02 +01:00
saurabh
d3a366fd0d Addition of volume/snapshot_metadata CLI
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
2013-10-15 23:41:08 +05:30
Jenkins
873bed99a8 Merge "Fix the failure of fetching the version in cinder endpoint" 2013-10-14 20:00:40 +00:00
Chuck Short
68fe7735c0 python3: iteration order of dict is unpredictable
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>
2013-10-13 21:15:31 -04:00
Chuck Short
fcf8e1d0b9 python3: align the order of parameters for urlencode()
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>
2013-10-13 09:49:29 -04:00
Chuck Short
5c462987d2 python3: sort dict for post_volumes_1234_action test
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>
2013-10-13 08:39:38 -04:00
Jenkins
0c2839414f Merge "python3: Refactor dict for python2/python3 compat" 2013-10-13 05:53:35 +00:00
Jenkins
728a3419c9 Merge "Fix DeprecationWarning when printing exception" 2013-10-11 22:33:17 +00:00
Chuck Short
b0b8afaf55 python3: Refactor dict for python2/python3 compat
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>
2013-10-11 09:04:49 -04:00
OpenStack Jenkins
82622357cd Updated from global requirements
Change-Id: I4f26d3a8790c799e5c1f7f81031406e0c57545f9

Change-Id: Ica7315effe308bd739e90f885849fac27a3c542b
2013-10-10 20:26:37 +00:00
Eric Harney
98e9df62ee Fix DeprecationWarning when printing exception
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
2013-10-09 17:31:49 -04:00
jenny-shieh
f96dcd714e Fix the failure of fetching the version in cinder endpoint
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
2013-10-09 12:05:53 -05:00
John Griffith
4a507601d7 Update docs/index.rst with release info for 1.0.6
Add features and bugs list for 1.0.6 pypi release.

Change-Id: I27134a04670bcfd1bca201ce1e0bba201e8ff98c
2013-10-04 08:52:14 -06:00
Jenkins
edffce38e7 Merge "Error if arguments are not supplied for rename commands" 2013-10-03 23:35:23 +00:00
Jenkins
ec88802986 Merge "Synch up with OSLO-Incubator" 2013-10-03 23:25:33 +00:00
Jenkins
5e925f8fd3 Merge "Fix find volume for migrate command" 2013-10-03 23:25:32 +00:00
Jenkins
5e41e7e09f Merge "Implement qos support" 2013-10-03 23:21:50 +00:00
Seif Lotfy
6437166e1e Add quota-usage command
Added a new command quota-usage to allow querying the usage of the
quota for a given tenant

Change-Id: I720e6df94f9fedbb8b6385bd1707600542aaea08
2013-10-03 17:43:20 +00:00
Jenkins
10a3c0fc84 Merge "Use v2 endpoint with v2 shell for migration" 2013-10-03 11:13:06 +00:00