199 Commits

Author SHA1 Message Date
Jenkins
d123164f30 Merge "Add strict Boolean checking" 2016-06-27 17:05:59 +00:00
xiexs
e5e0a7ee49 Add strict Boolean checking
Because of lack of strict boolean checking, the unexpected
'False' value will always be send to server if invalid bool
value is specifed.
For instance:
  the parameter 'is-public' of cinder type-update,
  the parameter 'force' of cinder qos-delete
as so forth.

This patch tries to add a strict checking for them
to prevent invalid bool value.

Change-Id: I896ddbb6ec4760bfd4d721db960138e2df0b86e1
Closes-Bug: #1596418
2016-06-27 08:41:11 -04:00
xiexs
f0f8e6b5ab Fix Service.__repr__ to remove the undefined attribute
The self.name is undefined in the Service class.
And also there is no need any unique information to
identify this object, so we just remove it directly.

Change-Id: I3ce8663f830357855f2155e080393ea97f8f80ba
Partial-Bug: #1585024
2016-06-25 11:45:38 -04:00
xiexs
906c9986a7 Make __repr__ print encryption_id for VolumeEncryptionType class
The self.name attribute is undefined in the VolumeEncryptionType
class. Instead we should print the self.encryption_id attribute
in the __repr__().

Change-Id: Ic11b45069145bbae078c8175928c5dd869bd8cb8
Partial-Bug: #1585024
2016-05-27 07:24:52 -04:00
Eric Harney
04ca787f5b Use six.moves.urllib.parse urlencode
Rather than having to do try/except for imports,
just use six.moves for loading this module.

Change-Id: If750253d7e02608fd183675bd97e3956fbfb0853
2016-04-20 10:55:54 -04:00
root
b83835d618 Removed Extra code
Some extra code is present like unused variables,
unreachable code after return statement etc.
Same is removed.

Change-Id: Ifca88a19625c56ed520321ecbdd91739a304be8e
2016-03-14 06:20:32 +00:00
Jenkins
186dfb4165 Merge "Add the version attribute to the Client class" 2015-12-08 20:13:33 +00:00
Eric Harney
6fe9f20663 Use oslo_utils encodeutils and strutils
With oslo-incubator being deprecated, move
our use of strutils to oslo_utils.

This leaves in place the use of oslo-incubator's
strutils by other oslo-incubator modules for now.

Change-Id: Ic4e50060b42aeca9d1e54424a8a3a123140fbf2a
2015-11-23 10:44:12 -05:00
Kurt Martin
cb08ce33eb Fix volume size units to match the API
Both Horizon and the cinder client documents the size paramater in
gigabyes(GBs) but the API docs(both v1 and v2) list the size units as
gibibytes(GiBs). The correct unit should be gibibytes(GiBs). This
should help in clearing up any confusion on what units are used in
Cinder.

Closes-bug: 1511167
Change-Id: I42e15c18d1f084d435a2be9b343fb2f6c3cf377f
2015-11-03 15:24:29 -08:00
Yuriy Nesenenko
349eb96052 Add the version attribute to the Client class
There is a way to get the version of the API being used. We need such
feature to work correct with different versions of the Cinder API
from third-party tools.

Change-Id: Ifde689df08644f9452138a9cd22052bc57fcb5d5
2015-10-28 09:50:02 +00:00
Ankit Agrawal
029b51d378 Use dictionary literal for dictionary creation
Dictionary creation could be rewritten as a dictionary literal.
for example:

body = {}
body['provider'] = args.provider

could be rewritten as

body = {'provider': args.provider}

TrivialFix

Change-Id: Ieae7b33332eca31754cbfe91288ef3001c573eb3
2015-09-24 00:06:30 -07:00
Rajesh Tailor
dc6e82328f Fix help message for reset-state commands
Fixed help messages for reset-state and snapshot-reset-state
commands for v1 as well as v2 api.

Change-Id: I06ca6e33f4e4b486ed29f258325550b89f6dc930
Closes-Bug: 1489285
2015-08-26 23:04:16 -07:00
Tom Jose Kalapura
dc1186dc44 Add response message when volume delete
When a request is send for deleting a volume it will not print any
success message if it deleted successfully.It will print only error
message if the volume deletion fails. This fix will print response
message if the volume deletion is success.

Change-Id: Icef2045107e1dcc3b7f2abfeb50b3f180ded1a27
Closes-Bug: #1475430
2015-07-16 19:45:08 -07:00
Jenkins
adf0db00c6 Merge "Add search_opts into the method list() for qos specs" 2015-07-06 17:31:45 +00:00
Jenkins
df3287f192 Merge "Fixes quota-class-update commands" 2015-06-16 19:07:34 +00:00
Jenkins
9cb7232655 Merge "Support host-attach of volumes" 2015-06-09 20:12:07 +00:00
Jenkins
ce8d636535 Merge "Fixed typos and repeated docstrings" 2015-06-04 01:25:59 +00:00
Tomoki Sekiyama
e1ff87378a Support host-attach of volumes
This patch adds the host_name optional argument to attach API
in order to enable users of cinderclient to attach volumes
not only to the instances but also to the hosts.

The API interface is implemented in
https://review.openstack.org/#/c/34125/ .

Change-Id: I0ff8ef19d1e3073fee1b9ec0f60609c37dfab9ab
Implements: blueprint host-attach
2015-06-01 15:33:18 -04:00
Swapnil Kulkarni
5fb6f5c76b Fixed typos and repeated docstrings
Updates in
[1] volume_snapshots.py (v1 & v2)
[2] qos_specs.py (v1 & v2)
[3] volumes.py

Closes-Bug: #1343844
Co-Authored-By: Chandan Kumar <chkumar246@gmail.com>
Change-Id: I867a9eae6e1907b941e49928c6aa976d261d159a
2015-05-13 11:34:35 +00:00
Anton Arefiev
c5c2d67b7f Find resource refactoring
The 'name' field for some resources is called something different,
for example 'display_name' for volumes, 'name' for  volumes type.
So class 'resource' has attribute 'NAME_ATTR' wich contains
attribute name for different resources.

This change removes reduntant call find in resource manager, instead
of it checks NAME_ATTR value.

Related-Bug: #1449444
Change-Id: Ide334d7535c73cbdff72c30319eb539d8f5304d6
2015-05-12 14:52:46 +03:00
Anton Arefiev
a96725e2ad Add search_opts into the method list() for qos specs
ManagerWithFind.findall require  search_opts for all tenants support,
the parameter search_opts should also be in all manager classes, which
use find method, qos spec does't have this parameter for list().
This change add it.

Change-Id: Iea619d66d217d92047a5b965d1e375acc97fa65b
Related-Bug: #1252665
2015-04-29 12:45:28 +03:00
Anton Arefiev
235622bf8e Support pagination param limit in volume list in V1
Since v1 api supports limit param in volume list, cinderclient
should support it too.

Change-Id: I60ffe0190a61dee354de5bc60ea3210c666bf6f2
Closes-Bug: #1447162
2015-04-22 16:23:47 +03:00
yatin karel
fa8c7e3d84 cinder list now supports filter by tenant
Admin can now filter volumes on the basis of tenant.
Also updated help argument, to be consistent over the
v1 and v2 shell module.

Closes-Bug: #1341411
Change-Id: I647f0c9331ee4cd27acbfada6cdb9a56f80701b4
2015-04-12 17:02:18 +05:30
yatin karel
f47f973d9b Updated help on cinder reset-state cli
volumes also have 'in-use', 'attaching' and 'detaching' states.
These were missing in cinder help for reset-state cli. I have added
these in help.

Partial-Bug: #1309086

Change-Id: I094a61dd4921bed83e97134a4bfbcdc7d0c9ad63
2015-03-06 01:45:08 +05:30
liyingjun
9db3430ccd Fixes quota-class-update commands
The quota-class-update commands for v1 and v2 are both broken,
Fix v1 by returning result for update method in QuotaClassSetManager,
fix v2 by changing arg 'class-name' to 'class_name' for consistent
with v1.

Change-Id: Ic7188f485b914dc55048cf056a0685618134e87a
Closes-bug: #1423884
2015-03-02 23:29:07 +08:00
Jenkins
ae9dd86093 Merge "Make cinderclient metadata CLI output consistent" 2015-03-02 00:21:11 +00:00
liyingjun
c01529fa53 Add missing all-tenants option to transfer-list
cinder transfer-list is missing the --all-tenants option, which makes
it inconsistent with 'cinder list'. Without this fix, when running as
admin horizon will need to make multiple queries to cinder (one for
each tenant present in the volume list) in order to display the transfers
that exist for the volumes being shown.

Change-Id: Ic4d72a54c450876ff24c64efd83678062c93a24e
Closes-bug: 1351084
2015-02-24 16:11:46 +08:00
Jenkins
9dcb38f5f2 Merge "Fix up help message for reset-state call" 2015-02-05 14:56:32 +00:00
John Griffith
e9e8aab2ec Fix up help message for reset-state call
There's some confusion about what the reset-state
call does.  It's not clear to some that this call
simply changes the state of the object in the data-base.

This patch just updates the help message to indicate more
clearly that reset-state ONLY changes state in the DB.

Change-Id: Ia389cfd8b1a821a356706201c009cf3c8dca8419
2015-01-28 13:36:20 -06:00
Zhiteng Huang
200aeae76c Remove commented code in cinderclient/v1/volumes.py
migrate_volume_completion() function in Volume class was commented
out when it was added.  It hasn't been changed since then.  This
change remove it.

Change-Id: Iad8c88e20268265f9063e2faa2a21514439150ad
2015-01-15 10:56:27 +08:00
Thang Pham
fdba364b7d Make cinderclient metadata CLI output consistent
cinder metadata-update-all and metadata-show produces
inconsistent output. The following patch makes the output of each
command above consistent, where each metadata property will
be printed on a separate table row.

Change-Id: I42933bc6c0e4f925c19cfd4db6d1a205de06a73d
Closes-Bug: #1366289
2015-01-13 16:09:34 -05:00
Jenkins
4154f88fa1 Merge "Add the parameter bypass_url to the cinder client" 2014-12-01 19:10:17 +00:00
Vincent Hou
7a50182fbe Add the parameter bypass_url to the cinder client
If the bypass_url is specified in the http client, there is no need
to get it from Keystone.

Change-Id: I891849f77ad2ba98a83c993b401121216c8cfff6
closes-bug: #1350702
2014-12-01 02:43:52 +00:00
Duncan Thomas
4ccb70a90f Support Volume Backup Quota
Python-cinderclient support update volume backup quota.

Cinder server side commit for this feature was:
https://review.openstack.org/#/c/111460/

blueprint volume-backup-quota

Change-Id: I1fceeb9fc0eb92370e249c46749a61e4b11420b0
2014-11-30 19:37:10 +02:00
Jenkins
5b172959c6 Merge "Fix 'search_opts' error with backup delete command" 2014-11-30 06:39:01 +00:00
Jenkins
d6f4ab3c96 Merge "Fixed typos found by RETF rules" 2014-11-25 03:02:01 +00:00
seungjin
029a776455 Fix 'search_opts' error with backup delete command
The following error message is yield when we try to
backup volume which is not present.

ERROR: list() got an unexpected keyword argument 'search_opts'

This is from findall() method in the
cinderclient.base.ManagerWithFind class.

When cinderclient get a specific resource, it use the findall() method.

The error will yields which list() in
VolumeEncryptionTypeManager did not have.

Change-Id: Iffe568c6d2de41b8e24658f3a54f2861e2f7db31
Closes-Bug: #1282324
Related-Bug: #1248519
2014-11-25 01:28:54 +00:00
Jenkins
9bd8c5dff9 Merge "Use adapter from keystoneclient" 2014-09-09 16:01:33 +00:00
Jenkins
42d13be346 Merge "Quotaset update does not return result" 2014-09-08 20:26:05 +00:00
Christian Berendt
17e4d6c381 Fixed typos found by RETF rules
Rules are available at
https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos

Change-Id: I8de0631346b703870ce8ebe9ce728a0360f1ba7f
2014-09-08 11:31:22 +00:00
Jamie Lennox
84af49ce97 Use adapter from keystoneclient
The keystoneclient provides an adapter which maintains the client state
around the session. We should re-use this rather than copy it and it
also means we will get new adapter functions and parameters as they
become available.

Change-Id: I05c0d650dcdd69f7e77a06563d735efe521a41ae
2014-09-02 12:38:03 +10:00
Jenkins
0c5f0a92b4 Merge "Avoid extra lookups in extra-specs-list" 2014-08-23 15:27:05 +00:00
JordanP
6565e275fd Avoid extra lookups in extra-specs-list
extra-specs-list used to use the extra-specs cinder extension
to get information on volume type extra specs. This information
is publicly available through the volume-type API [1] thus we
can avoid the extra-lookups of querying the extra-specs extension.

As the extra-spec info is publicly available, remove the part of
the docstring of cinder extra-specs-list that says 'admin only'.

[1] http://docs.openstack.org/api/openstack-block-storage/2.0/content/GET_getVolumeTypes__v2__tenant_id__types_Volume_Types.html

Change-Id: I9a8256a044511ac5233d8170fc57118ccaa1e217
Closes-Bug: 1343876
2014-08-05 11:28:09 +02:00
Jenkins
88ee3b385c Merge "Fix the return code of the command reset-state" 2014-08-03 17:14:06 +00:00
Juan Manuel Olle
02b32c8aed Quotaset update does not return result
This patch adds the updated quota values to the output shell

Closes-Bug: #1316474
Change-Id: I95bbefa5fdee316a3a3ba77a5b3067345da3344f
2014-07-29 17:56:07 +00:00
Zhengguang
bf8fa0b606 Fix the return code of the command reset-state
Currently, the command reset-state return code is zero if it
failed for any of volumes, it should be nonzero.

Change-Id: Ic6da238861fd003375003399bc6def6bf860a015
Closes-Bug: #1339643
2014-07-28 09:08:36 -04:00
Jenkins
0c4010e7fb Merge "Add set-bootable command" 2014-07-16 22:30:28 +00:00
liyingjun
ae04b4b099 Add tenant uuid when running cinder list --all-tenants
Add the tenant uuid to the output when running cinder list --all-tenants,
since this is an admin command any way, it would help to list the tenant
UUID so we do not have to run cinder show to see the tenant uuid when we
have further queries to run.

Change-Id: I661789e957fa00947c4d5595f7e0515c27963735
Closes-bug: 1333257
2014-06-27 03:29:27 +08:00
Jenkins
6550b0ab5c Merge "Remove "OPTIONAL:" from optional argument help text" 2014-06-25 19:38:01 +00:00
Jenkins
408994c855 Merge "Fix Volume.extend and Volume.update_readonly_flag methods" 2014-06-23 14:45:52 +00:00