128 Commits

Author SHA1 Message Date
Jenkins
55378953e2 Merge "Clean up FakeClient classes in volume fakes" 2016-09-06 14:03:38 +00:00
Jenkins
20ad61b9d4 Merge "Add "volume service set" command" 2016-09-06 03:40:31 +00:00
Huanxuan Ao
8f07fec3f2 Clean up FakeClient classes in volume fakes
Put FakeTransferClient and FakeServiceClient classes
into FakeVolumeClient class, I think we need not to
create FakeClient classes for every objects, we can use
only FakeVolumeClient for all volume objects. This can
reduce repetition, unified codes and make codes look
cleaner and easier.

Change-Id: I2729ef0e80166f4d49ccd9a48b653e2f215e3bfe
2016-08-23 10:31:24 +08:00
Jenkins
8f63da4621 Merge "Fix errors in volume set/unset image properties unit tests" 2016-08-19 02:48:08 +00:00
Huanxuan Ao
81431d24a9 Add "volume service set" command
Add "volume service set" command in volume v1 and v2
(v1 is the same as v2) to disable or enable volume service.

Change-Id: Ibb2db7e93b24cb2e0d2a7c28b6fd8bcc851b8d2f
Closes-Bug: #1613597
2016-08-17 10:42:28 +08:00
Huanxuan Ao
95f0e3dc36 Fix errors in volume set/unset image properties unit tests
These errors may caused by copy-paste, we should specify
a fake return value for get() method but not create() method.
Create() mothod will not called in set/unset command. After
specifing the return value of get(), we can use the fake volume
in the assert.

Change-Id: I1e0df4c28ece373168788c396e9082d565e36cc7
2016-08-11 11:43:03 +08:00
Huanxuan Ao
39c5eb9e3f Rename backup commands in volume v1 and v2
Backup commands are used only in volume service now,
but "backup" is too generic, users may not know the
commands are used for volume from the commands name.
By seeing the command name, users can only see the
"backup" but do not know which object the backup
commands work for. It may confuse users. I think
rename "backup" to "volume backup" can depict resource
relation and will be helpful for users to know the
commands clearly.

So add new commands ``volume backup create/delete/
list/show/restore`` to replace the old commands
``backup create/delete/list/show/restore``. And also
deprecate old commands.

Change-Id: I4f844d9bc48573eb4d17288ce6b8a90cea00d16a
Implements: bp backup-snapshot-renamed-for-volume-resource
Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com>
2016-08-11 09:32:10 +08:00
Huanxuan Ao
3202fefc65 Support multi REST API calls error handling for "volume set" command
Support the error handling follow the rule in
doc/source/command-errors.rst
Also add a unit test for testing the error handling

Change-Id: I98064f4b8c1dc17eb3874f7b25c827a568463c0f
2016-08-06 09:15:21 +08:00
Xi Yang
20ae54045c Add support of setting volume's state
OSC does not support to set volume's state, this
patch is going to add this functionality.

Closes-Bug:#1535213
Change-Id: I5bc1c7e81b8ba61c37f4bfd209fc86c5857fb050
Co-Authored-By: Huanxuan Ao <huanxuan.ao@easystack.cn>
2016-08-03 12:19:16 +08:00
wuyuting
954c28dfa2 Add support for deleting volumes with associated snapshots
OSC doesn't support deleting volumes with associated snapshots.
This patch provides support for deleting volumes with associated
snapshots by adding an optional argument.

Change-Id: I7e74f251574993ff13a38e508fd2f9debeda8d0a
Closes-Bug: #1589332
Co-Authored-By: Rui Chen <chenrui.momo@gmail.com>
2016-07-27 11:30:52 +08:00
Jenkins
7a667d700f Merge "Use identity fake classes instead of old unit tests data" 2016-07-26 15:13:20 +00:00
Jenkins
6da7a127af Merge "Add options to "volume type list" command" 2016-07-26 10:53:40 +00:00
Huanxuan Ao
1b2ea91420 Use identity fake classes instead of old unit tests data
Use FakeProject, FakeDomain and FakeUser classes instead
of old test data in image, compute and volume. (This work
has done in network)

Change-Id: Ic37d5d9db98f0f2acc6c714a9646063dcbde4ff3
Partially-Implements: blueprint use-fake-project
2016-07-26 18:38:12 +08:00
Huanxuan Ao
e31408d2a4 Add options to "volume type list" command
Add "--public" and "--private" options to
"volume type command" in volumev2 (v2 only)
to list optional volume types

Change-Id: I8605990d62116c10d89ce192c14e550657dabee5
Closes-Bug: #1597198
2016-07-23 11:26:49 +08:00
Huanxuan Ao
61b9d9fe2d Add "--marker" and "--limit" options to "snapshot list"
Add "--marker" and "--limit" options to
"snapshot list" command in volume v2 (v2 only).

Change-Id: Ib60840b9b83dfe5e599e4037e8ec308844a9448b
Closes-Bug: #1605475
2016-07-23 10:41:28 +08:00
Sheel Rana
5e8957ef7f Show project access for volume type
OSC does not support to show project access details for
private volume types. This patch will provide support
for showing project access details for private volume types.

Closes-Bug:#1554891

Implements: bp cinder-command-support

Change-Id: I218fb07a6e69033e9f8570748eee1df8df9d6fdc
2016-07-20 16:54:58 +08:00
Jenkins
6ce53fed83 Merge "Support error handling for delete commands in volumev2" 2016-07-18 22:41:07 +00:00
Jenkins
099c3bbd82 Merge "Add "--project" option to "volume type create" command" 2016-07-18 19:38:02 +00:00
Huanxuan Ao
9b51127ecc Support error handling for delete commands in volumev2
Some delete conmmands in volumev2 did not support
error handling, this patch add them and also add
the unit tests for bulk deletion

Change-Id: I56ade6f9c7396c78fb989547476c4d94ccd76eae
2016-07-14 17:49:26 +08:00
Huanxuan Ao
e310682235 Add "--project" option to "volume type create" command
Add "--project" and "--project-domain" options to
"volume type create" command. We can use these options
to add the type access to a given project when we
create the volume type.

Change-Id: I483a6b61dae137682c3d1f7527531b40e508ba92
Closes-Bug: #1602169
2016-07-12 19:23:47 +08:00
Huanxuan Ao
f79f671338 Change the wrong import order
Change-Id: Ia48f0aae0250a5d29c0f6fa46386465e118f760f
2016-07-12 16:51:21 +08:00
Jenkins
5a21eb2555 Merge "Add "--incremental" option to "backup create" command in volume v2" 2016-07-11 20:15:15 +00:00
Jenkins
357d7e75f3 Merge "Unskip tests caused by bug 1599333" 2016-07-11 19:40:14 +00:00
Paul Bourke
34812655a5 Add "--incremental" option to "backup create" command in volume v2
Cinder V2 API supports creating volume backup with "--incremental"
option. However, OSC doesn't support this argument. So this patch adds
the "--incremental" option to allow users to create incremental style
backups.

Change-Id: Iefac5f1a6c9ef006ad9c22d4250ae6df50504781
Closes-Bug: 1600196
2016-07-11 13:29:59 -04:00
zheng yin
94f654b010 Remove FakeService.get_services
FakeService.get_services is useless in other test files, so remove it

Change-Id: If90b8742be97697f285750a05896b574c45f3504
2016-07-09 05:37:55 +08:00
Steve Martinelli
9f09d8c5d4 Unskip tests caused by bug 1599333
There is now a second .get() call in osc_lib.utils.find_resources.
These tests were failing because they only mocked a single access
call to .get(). Ensure there are two calls to .get(), with the
first one raising an exception.

Change-Id: Idd2ad4a27a6db5bee633cc37a1042dbb0a57aa71
Closes-Bug: #1599333
2016-07-07 22:54:23 -04:00
Jenkins
e0b63e64c1 Merge "Add "--property" option to "snapshot create" command in volumev2" 2016-07-06 15:31:39 +00:00
Jenkins
f1a27a73d6 Merge "Add '--force' option to 'backup delete' command in volumev2" 2016-07-06 14:59:53 +00:00
Huanxuan Ao
f5aef9ac36 Add '--force' option to 'backup delete' command in volumev2
Add '--force' option to 'backup delete' command in
volumev2 (v2 only) to allow delete in state other
than error or available.

Change-Id: I661ea0d465db227e374cbacdde0206fa1a6dd3d5
Closes-Bug: #1597188
2016-07-06 20:51:01 +08:00
Huanxuan Ao
3222ffc157 Add "--property" option to "snapshot create" command in volumev2
Add "--property" option to "snapshot create" command
in volumev2 (v2 only) to support adding properties to
a new snapshot.

Change-Id: Ie0e90c9ccc2ac89b3b7b0ac89751fd864aada9a4
Closes-Bug: #1597192
2016-07-06 20:46:31 +08:00
Steve Martinelli
72a82b2794 skip failing tests due to bug 1599333 is fixed
latest osc-lib breaks some of the tests, skip them for now
so we can continue to merge patches that are already approved.

Change-Id: I433190e9f763bea1df3135612b281d925745f884
Related-Bug: 1599333
2016-07-05 20:24:31 -04:00
gecong1973
6115dfe9f8 fix a few spelling mistakes
- overwriten should be overwritten
 - retrun should be return

Change-Id: I1567402f4d5c7253e6a54d8753e3f201af7e6a54
2016-07-04 15:15:23 +00:00
Huanxuan Ao
6364df4cbd Add "--snapshot" option to "backup create" command in volumev2
Add "--snapshot" option to "backup create" command to support
backing up a snapshot.

Change-Id: Ibecbf1902599875f422d372d529835f73211d3ec
Closes-Bug: #1597184
2016-07-01 10:06:10 +08:00
Jenkins
9422f8bdea Merge "Add "--force" option to "volume qos delete" command" 2016-06-28 18:26:03 +00:00
Huanxuan Ao
4e46c04f92 Add "--force" option to "volume qos delete" command
Add ``--force`` option to ``volume qos delete`` command in volume
v1 and v2 to allow users to delete in-use QoS specification(s).

Change-Id: I46036e5f55ced8b8a1be54c521f2a5c242b89160
Closes-Bug: #1596821
2016-06-28 08:12:40 +00:00
Huanxuan Ao
fc719f998c Add "--force" option to "backup create" command in volumev2
Cinder V2 API supports creating volume backup with "--force"
option. However, OSC doesn't support this argument. So this
patch add the "--force" option to allow users to back up a
in-use volume.

Change-Id: I326f8d6172b2830da4cf1317348af50142cc5490
Closes-Bug: #1596443
2016-06-27 16:59:51 +08:00
Steve Martinelli
4e62e1e2e1 support multi-delete for volume-type
Added the ability to delete multiple volume types at once. Note
there are no unit tests exist for v1 volume-types, so instead
a functional test was created.

Partial-Bug: #1592906
Change-Id: I99f3f22901ab35252b91a3072b14de7d19cb17ca
2016-06-20 16:42:36 -04:00
Tang Chen
0e9862be7a Standardize logger usage in volume
self.app.log is the logger in class OpenStackShell,
which should be used to record logs that have nothing
to do with any specific command.

So, use the file logger instead.

This patch also fixes some usage that doesn't follow
rules in:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html
1. add variables to logger as an argument
2. do not wrap variables with str()

Change-Id: I248861a38a4de0412a080046aa7a6f6473c3e082
Implements: blueprint log-usage
2016-06-14 16:37:57 -05:00
Dean Troyer
e5e29a8fef osc-lib: utils
Use osc-lib directly for utils.

Leave openstackclient.common.utils for deprecation period.

Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
2016-06-13 10:50:44 -05:00
Dean Troyer
d20c863ebc osc-lib: exceptions
Use osc-lib directly for exceptions.

Leave openstackclient.common.exceptions for deprecation period.

Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
2016-06-13 10:50:01 -05:00
Huanxuan Ao
72d3ebd94c Clean up fakes.py in volumev2
All of volumev2 fake classes are completed.
Now the unit tests of volumev2 are using fake
classes so that the old codes are useless and
can be removed.

Change-Id: I502a8a0b0404975744d3b208af3e95c8692e6c47
2016-06-08 13:36:16 +08:00
Huanxuan Ao
0fd3a8c787 Update unit test test_extension with fake class
Add FakeExtension class in networkv2, computev2, volumev2,
identityv2_0 and update unit test test/common/test_extension.py

Change-Id: I94815de7801860edb7fa91a7d146455cab946652
2016-06-07 16:17:42 +08:00
Jenkins
dd0fe3d94e Merge "Fix errors for "volume type unset" command" 2016-06-07 01:31:50 +00:00
Jenkins
376e3379ee Merge "Make set/unset commands in volume return normally when nothing specified" 2016-06-06 21:48:12 +00:00
Huanxuan Ao
4bea5d37d9 Fix errors for "volume type unset" command
Normally, we can unset multi properties but the "volume type unset"
command could not, because the action "append" was missed. So I add
it and also fix the unit test and doc in this patch.

Change-Id: I20470f2b7bb2a8d7f292cea498826669c3418c77
2016-06-06 19:04:36 +08:00
Jenkins
1c097b777c Merge "Add support for volume transfer request list" 2016-06-04 20:36:24 +00:00
Sheel Rana
2178cedef1 Add support for volume transfer request list
OSC does not support to list volume transfer from one user
to other user.
This patch will provide support for listning volume transfer
requests.

Closes-Bug:#1554886

Implements: bp cinder-command-support

Change-Id: Ie659bc39cb1d1e931cca7a40b2f126a067ee484c
2016-06-04 18:26:59 +00:00
Tang Chen
2672e37ee2 Make set/unset commands in volume return normally when nothing specified
set/unset commands should ends up normally instead of
logging an error when nothing is specified to modify.
The main reason is: When nothing is specified, the
command sets/unsets nothing, which is a normal behavior,
and ends up normally. No API call fails. No error happens.

Change-Id: Ib03a512650e5da90aa1ef38019772448383d0d33
Partial-bug: #1588588
2016-06-04 21:29:44 +08:00
Jenkins
6088d31ca9 Merge "Add FakeQos class and update unit test for qos_specs in VolumeV2" 2016-06-02 05:34:17 +00:00
Huanxuan Ao
677dfaa925 Fix unit test for volume commands in volumev2
There are some issues in test_volume.py in volumev2,
I make three changes in this patch:

1.modified some codes that not used FakeVolume class.
2.added a fake image by FakeImage class for this test.
3.added a fake snapshot by FakeSnapshot class for this test.

Change-Id: I02ba73d3aaee95624b0e2307b255e0e485b0c3a3
2016-05-31 17:36:02 +08:00