Leverage the new cliff command class attribute (_description)
to get the help of a command, this allows us to mark strings
for translation. We could not do this before since the help
was grabbed from the docstring.
This also depends on a new release of cliff and a bump to the
minimum level in osc's requirements.
Closes-Bug: 1636209
Depends-On: Id915f6aa7d95a0ff3dc6e2ceaac5decb3f3bf0da
Change-Id: I8673080bb5625e8e3c499feaefd42dfc7121e96f
Similar to what 'volume list --all-projects' does, 'volume backup
list --all-projects' list volume backups accross all projects.
Change-Id: Id5dda9b5adc822c4ddfb2dda339946d3322858e2
Add "--read-only" and "--read-write" options in "volume set"
command to set volume access mode.
Implements: bp cinder-command-support
Change-Id: I76ba85c7d3ff0eb026a9cbd794368d8b2b0d17fe
Add "volume migrate" command in volume v1 and v2
to support migrating volume to a new host
Change-Id: Ie4e6037171a31a872006a13f9fd1e15eaa627c26
Implements: bp cinder-command-support
The error messages are tuples and not substituting variables.
Before:
$ openstack volume set vol1 --size 1
Failed to set volume size: (u'New size must be greater than %s GB', 2)
$ openstack volume set vol1 --size 1
Failed to set volume size: (u'Volume is in %s state, it must be available
before size can be extended', u'error')
After:
$ openstack volume set vol2 --size 3
Failed to set volume size: New size must be greater than 4 GB
$ openstack volume set vol2 --size 3
Failed to set volume size: Volume is in error state, it must be available
before size can be extended
Change-Id: Ide6e644b1c6d1c11a9dc2f3f53c1a1837380b8d5
1.Add mutually exclusive options into a mutually
exclusive group.
2.Add "--source-replicated", "--consistency-group",
"--hint" and "multi-attach" options
3.Make --size option to be optional under some cases
Closes-Bug: #1568005
Closes-Bug: #1627913
Implements: bp implement-cinder-features
Co-Authored-By: Roman Vasilets <rvasilets@mirantis.com>
Change-Id: I2c4c3073195d33774e477f4d7f22e383b14b41dd
There are some set commands can set object state, it maybe
a danger behavor for users, so add explanation and warning
in the help message of the "--state" option to talk users
be caution when using (cinderclient have done this too)
Change-Id: I6a902887ea98879999c9972f36b1b7ef332173c3
After I found this problem appear in "volume unset",
I checked all the volume command and also found some
same problems. This patch fix them all.
The main reason of we ignored this problem before is
there was not any tests for it. So I add tests for
"nothing unset" for them all to test and aviod this
problem.
Also, I add unit tests for all snapshot commands
in volume v1 by the way in this patch. We will
need more tests to avoid some ignored problem.
Change-Id: I46775f24643d715e168b30785b8b531c0431a55b
Partial-bug: #1588588
Add "volume transfer request show" and
"volume transfer accept" commands in
volume v1 and v2. Also add the unit tests,
docs, release note and functional tests
Implements: bp cinder-command-support
Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com>
Change-Id: I5787fc486b3401307125caa316f517b9c96a95a5
Add "volume backup set" command in volume v2 (v2 only)
to set backup name, description and state
Change-Id: If17e8457db9a4704fb5bb9c75921ed82fd0069cf
Closes-Bug: #1613261
When nothing specified in "volume unset" command, there
will be an error message says that the "--properties"
option is required, it is unusual behaviour, this patch
fix it and also add unit test for it.
Also, this patch add unit test for "volume show" command
by the way.
Change-Id: I5b5d587670acf0af4262b8521292455bf9f60fe5
Partial-bug: #1588588
The help message of command "openstack volume show" accepts either
volume-name or volume-ID. But the metavar is "volume-id" as below.
It can easily lead to misunderstanding.
usage: openstack volume show [-h] [-f {json,shell,table,value,yaml}]
[-c COLUMN] [--max-width <integer>]
[--noindent][--prefix PREFIX]
<volume-id>
Change-Id: I57576ea23868b1026cf268be69b39e98a53aafd4
Add --bootable | --non-bootable option in volume set
to mark or unmark volume as bootable.
Change-Id: Ifa6c2dd1642202f55b6d50e3b8614d3513d488f6
Closes-Bug:#1535704
Add "volume transfer request delete" command in
volume v1 and v2. Also add the unit tests, docs,
release note and functional tests
Change-Id: Ic3d375bc8df3312fac53c1800d75f48376b8c91c
Implements: bp cinder-command-support
Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com>
Add "volume transfer request create" command in
volume v1 and v2. Also add the unit tests, docs,
release note and functional tests
Change-Id: If362df1acf214efdf6ba129cd917d33eb54e1030
Implements: bp cinder-command-support
Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com>
Support multi REST API calls error handling for
"snapshot set" command follow the rule in
doc/source/command-errors.rst. Also add a unit
test for testing the error handling
Change-Id: I0c6214271bc54a25b051c0a62438c3344c8b51d7
Some delete commands in volume v1 support multi delete
but do not support error handling, this patch fixes them,
and this patch also refactor (or add new) unit tests for
some delete commands in volume v1.
Change-Id: Ia8177698f8733cfe75ea0ff00eee8fdc0820f62e
Support multi REST API calls error handling for "volume unset"
command follow the rule in doc/source/command-errors.rst.
Also add a unit test for testing the error handling
Change-Id: I2de7a7bd5a7a5e39817ed5cf6952abf4afba75e4
"os-volume-type-access:is_public" property is the
same as "is_public" property in volume type object.
So stop showing "os-volume-type-access:is_public"
property and leave "is_public" property only.
Change-Id: Ic78a9ee69b0ab356edff18cdb4c46fc24b495d2b
Closes-Bug: #1620922
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
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>
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
Convert to using ClientManager and OpenStackShell from osc-lib.
* Change all internal uses of ClientManager private attributes that are
now public in osc-lib's ClientManager. Leave back-compat copies in
place in OSC's clientManager so we don't break plugins.
* Put some work-arounds in place for changes in osc-lib that we need until
a new release makes it through the g-r and u-c change process.
* Add a test for Unicode decoding of argv in shell.main() to parallel
the one in osc-lib.
Change-Id: I85289740d4ca081f2aca8c9b40ec422ad25d302c
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>
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>
Add "--public" and "--private" options to
"volume type command" in volumev2 (v2 only)
to list optional volume types
Change-Id: I8605990d62116c10d89ce192c14e550657dabee5
Closes-Bug: #1597198
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
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