243 Commits

Author SHA1 Message Date
Peter Hamilton
6fd8d8e12e Require ctrl_location for encryption-type-create
This bug fix addresses bug #1267168, adding a default value to the
optional control_location parameter for the encryption-type-create
command. Prior to this fix, any invocation of encryption-type-create
that omitted the control_location parameter would fail. The failure
arose from the expectations of the cinder volume encryption type
API extension, which expects to always receive a value for the
control_location on encryption type creation.

control_location indicates which service will conduct the volume
encryption for the encryption-type under consideration; valid options
are 'front-end' (i.e., nova) and 'back-end' (i.e., cinder). The new
default value is 'front-end' and is used whenever control_location
is omitted from encryption-type-create invocation. For prior
discussion and information, see the abandoned patch below:

https://review.openstack.org/#/c/58303/

blueprint encrypt-cinder-volumes
https://blueprints.launchpad.net/nova/+spec/encrypt-cinder-volumes

Change-Id: I8db80929adbf5a3d818b9d3a8115067ae8e7d9e2
Closes-Bug: #1267168
DocImpact
2014-02-12 21:38:41 +02:00
Swapnil Kulkarni
4273bbefb9 Fix typos in cinderclient
Small nit-pics in volume_transfers.

Change-Id: I846b38970b14e6385269a02bb495c63464ea0842
Closes-Bug: #1255905
2014-02-05 16:23:23 +02:00
Mike Perez
e31e057ccc Revert "Update cinderclient to skip the additional GET during create"
This reverts commit 47014971b09f0334e5cc3b414bef31784f88a37d.

Conflicts:
	doc/source/index.rst

Change-Id: Ica1e526b2c181d1ce72183b7293d21119371c822
2014-02-04 14:14:22 -07:00
Andrew Kerr
019f43f63f Fixed image_name from image-name in upload-to-image
This fix addresses an issue where the variable name for image_name
was incorrect, causing the image_name parameter to be sent as null
when using "cinder upload-to-image" from cli with v2 of the API

Change-Id: I62f8bbb4397526fb291a46777d9025318da8e5b3
Closes-Bug: 1274552
2014-01-31 18:39:04 -05:00
Jenkins
7d7b7d2893 Merge "Sync up with oslo-incubator" 2014-01-30 01:31:20 +00:00
Eric Harney
306d451bc7 Add shell tests for snapshot_delete
snapshot_delete does not have a shell test covering it.

Closes-Bug: #1257747

Change-Id: I22252f5025c11a7c115aa75e07c78424eec75ba1
2014-01-27 13:48:12 -05:00
Jenkins
dd92af2a9e Merge "Remove RAX-specific auth in cinderclient" 2014-01-27 07:16:09 +00:00
Swapnil Kulkarni
c5b5646f9e Sync up with oslo-incubator
be81d6b Cleanup unused log related code
e53fe85 strutils bool_from_string, allow specified default
12bcdb7 Remove vim header
12d3bbc Add method quote_plus in module py3kcompat.urlutils
afdbc0a Fix E501 in individual openstack projects

Oslo Version:
8dee4b6 Merge "remove extra newlines that eventlet seems to add"
Thu, 23 Jan 2014 14:26:42 +0530 (08:56 +0000)

Change-Id: I7348e797a4a78ec20dff77ebdbb41bb8c6068b34
2014-01-26 16:13:11 +05:30
Jenkins
3b92c27deb Merge "Add volume retype command" 2014-01-26 06:18:23 +00:00
Jenkins
4fca766f4e Merge "Unit tests for limits.py in cinderclient/v1 and v2" 2014-01-25 23:36:43 +00:00
Avishay Traeger
58d8a00a57 Add volume retype command
Add volume retype to Cinder client.
Cinder code: https://review.openstack.org/#/c/44881/

Change-Id: Ied4902da531386f744403962e4a8ddfb7587c4ef
2014-01-25 15:55:23 -07:00
Jenkins
36a92e1286 Merge "disable/enable a service has no output" 2014-01-25 14:23:20 +00:00
Jenkins
560df45093 Merge "Fix 'search_opts' unexpected keyword argument error" 2014-01-25 06:38:20 +00:00
Swapnil Kulkarni
fbee97cf19 Remove RAX-specific auth in cinderclient
Change-Id: Idd36694a322f467ba5e8c1f58bfac701bff8f3f8
Closes-Bug: #966329
2014-01-25 08:22:13 +05:30
Jenkins
e2642796b8 Merge "Add encryption-type-delete to cinderclient" 2014-01-24 11:39:12 +00:00
Jay Lau
c2ef5eaf49 disable/enable a service has no output
When disable/enable a cinder service, there is no output, this
caused end user does not know if the service was disabled/enabled
successfully.

It is better add some output for the command just like nova to tell
end user the service status.

Change-Id: I9d440ab7437c268b17627e255f152db0b3bf4f53
Closes-Bug: #1261120
2014-01-21 22:57:23 +08:00
Xiao Chen
2f0863b7d4 Fix 'search_opts' unexpected keyword argument error
When executing 'encryption-type-create' command using resource
name, it will use the findall() in base.py, then error will
occur because list() in findall() used 'search_opts' argument
which list() in VolumeEncryptionTypeManager did not have. Some
other command like 'transfer-delete' met same issue.

This patch will add 'search_opts' argument in list() function
in child class to avoid the bug.

Closes-Bug: #1248519
Related-Bug: #1252665

Change-Id: If1cd8b812af21335e5d4351766539a927a8fbdf4
2014-01-20 15:43:31 +08:00
Alexander Ignatov
69188a9551 Remove copyright from empty files
According to policy change in HACKING:
http://docs.openstack.org/developer/hacking/#openstack-licensing
empty files should no longer contain copyright notices.

Change-Id: I357adea1d295cdc11a12194ad7116d73a8560122
Closes-Bug: #1262424
2014-01-16 02:12:43 +04:00
Igor A. Lukyanenkov
efc080dfca Unit tests for limits.py in cinderclient/v1 and v2
Change-Id: I962161ac657d9ec676f3b03ab17138ed1911ec35
2014-01-13 16:17:16 +04:00
Swapnil Kulkarni
47014971b0 Update cinderclient to skip the additional GET during create
With change https://review.openstack.org/64945 cinder V2 API now
returns volume details. Updated do_create in cinderclient
to remove additional GET call.

Change-Id: I2a36f2fa865b52f228bad44e0a9c67d49228321e
Partial-Bug: #1265893
2014-01-08 13:37:41 +05:30
Igor A. Lukyanenkov
1fc1b4bea1 Fix RateLimit.__repr__ - self.method is undefined
Using self.verb instead of self.method, unit tests added to cover this fix.

Closes-bug: #1258489

Change-Id: I4a84179ff96c50b230afcaea7a19fb54613577fb
2013-12-31 18:00:24 +04:00
Zhenguo Niu
12ee7b72ff Fix inappropriate comment for volume update api
Change-Id: Id7a436cc864772bd2662fce0ef80d647c9e3dcf0
Closes-Bug: #1264415
2013-12-27 10:38:25 +08:00
Jenkins
b6f9364f54 Merge "Fix broken argument name in v2 volume extend routine" 2013-12-12 19:47:05 +00:00
Jon Bernard
c6a85e0c1c Fix broken argument name in v2 volume extend routine
The new_size attribute was misspelled, causing the volume extend
operation to fail with:

    ERROR: 'Namespace' object has no attribute 'new_size'

This happens only with the v2 API, v1 works fine.

Change-Id: Icb6b5008dad229f21e7906d9b5342d41f5e760cd
Closes-Bug: #1259552
2013-12-10 08:46:27 -05:00
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
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
Peter Hamilton
38388f892b Add encryption-type-delete to cinderclient
This modification adds support for deleting volume encryption types.
The encryption-type-delete command accepts a single argument, the
name or ID of the volume type whose associated encryption type should
be deleted. The encryption type may only be deleted if the associated
volume type is unused.

blueprint encrypt-cinder-volumes

Change-Id: Ie189e7ec91f5a8adc9d3496911de2811ad40f282
2013-11-20 10:16:22 -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
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