Current "volume list --name" command use "display_name" as search_opts
to send to cinder API, and show the result table with "Display Name"
column title in osc, cinder list API support "name" as search opts too,
and there is "name" attribute in volume response body, so we can replace
all "Display Name" by "Name" in order to keep "volume list" command
consistent with other commands, like: server list, network list and so
on, only use "Name" attribute for all objects.
Support a mapping for volume list -c "Display Name" (Volume v1 and v2)
and volume create/show -c "display_name" (Volume v1) for minimal
backward compatibility until R release.
Change-Id: I120be0118e7bb30093b4237c5eeb69a9eedef077
Closes-Bug: #1657956
Depends-On: I1fb62219b092346ea380099811cbd082cae5bafe
Cleanup help strings and docs for clarity and to keep things consistent:
* --limit metavar should be <num-resource> to indicate what is being counted
* --marker metavar should be <resource> or <resource-id> to indicate the
type of value being specified
* <*-ip-address> metavars should be just <ip-address> as there is no difference
in format between fixed and floating IPs
* Move all occurances of '(name or ID)' to end of help text
Change-Id: I2c31746ed6ded3845244e03e57d809f8bc0e6b9d
Add "--bootable", "--non-bootable", "--read-only" and "--read-write" options
to "volume create" command for setting some attributes at the time of crration.
Change-Id: I71b4e9fccb4ee0ab1a90e7179d6d2d34dbbae909
Implements: bp cinder-command-support
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
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
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
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
Add --bootable | --non-bootable option in volume set
to mark or unmark volume as bootable.
Change-Id: Ifa6c2dd1642202f55b6d50e3b8614d3513d488f6
Closes-Bug:#1535704
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
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
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
This formats the volume command help text consistent with the rest of OSC,
adds some reference targets and some explanation text to some commands.
No functional changes have been made, only cosmetic/help output.
Change-Id: Ib86ec3ca58bdea5f33078ced3ec3583b2be0e89a
Previously each command logs take_action parameters explicitly
by using @utils.log_method decorator or log.debug().
Some commands have no logging.
This commit calls a logger in the base class and
drops all logging definition from individual commands.
Closes-Bug: #1532294
Change-Id: I43cd0290a4353c68c075bade9571c940733da1be
* Add volume list tests for v1 (a copy of the v2 tests)
* Converts volume v2 tests to use Identity v3 so domains can be tested
* Add volume list (v2) tests for new options
* Re-orders volume list options (both v1 and v2) to match
* MArks the new volume list (v2) options as v2-only in doc
Change-Id: I2181b2c48cfde2147d7d0ef135322df8a81e7ce8
Instead of duplicating the same log statement throughout
the code, the same logic can be provided by a shared decorator
that abstracts away the logging capability and unifies it behind
a common function instead.
Change-Id: Icc63bced7347c8bbf0299a4c5821425a10892a79
The three commands below
openstack volume unset
openstack snapshot unset
openstack volume type unset
Should have --property as a required argument,
not optional. The reason is the command will not work
without --property.
Closes-Bug: #1475872
Change-Id: Ib9e29392472db38982cc2817af2dd5055f5a01ca
Create a --size option for volume set, so the user may extend
a volume's size.
Change-Id: Ic8d3396d788a14ea1e10bf1da73edfd7f5d85070
Closes-Bug: #1413954
This is part1, add support for these objects:
compute.server
imagev1.image
imagev2.image
network.network
volume.volume
volume.backup
volume.snapshot
Closes-Bug: #1400597
Change-Id: Ice21fee85203a8a55417e0ead8b509b8fd6705c1
Previously, no data was being returned for the 'attached to' field
when listing volumes. Dig into the the returned array to format
the column.
Change-Id: Iebd79e5ddcb4a335703d9b2675aa7128995de918
Closes-Bug: #1404931
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.
Change-Id: Ic749ac9eb55564ed631d57055a5a4dfc3aebd169
This makes it consistent with the other --type options in OSC. Also
add a few more volume_create tests.
Change-Id: I50ef927932cabf157ecdfd6c4faa1914b4fdf413
This fixes some errors and inconsistencies I found reviewing the
help strings:
* Capitalize help strings
* Add missing space between words (in multi-line strings)
* Improve wording
Change-Id: I2fb31ab4191c330146e31c1a9651115a6657769a
This required https://review.openstack.org/26323 in keystoneclient,
merged long ago...
Also adds some tests for 'volume create'
Change-Id: I55bededbc20b5dcf2833c59eb2b6b069703d8a9a
* use six.iteritems()
* replace basestring with six.string_types
* convert print statements to functions (they're all debugging and should
be removed eventually anyway)
* clean up OpenStack copyright: LLC -> Foundation
Change-Id: Icb14212bcb408e63816bfec3922a697bc1a6c946
* Reformat default dict output to key='value' using utils.format_dict()
* Changes utils.get_item_properties() to pass the specific field to
the formatter function rather than the entire resource object, this
allows the formatter to handle multiple attributes.
* Updates server, volume, volume type commands
Change-Id: I90eebf6b84ae200532f09cd925f371598ea54a64
As discussed in https://review.openstack.org/#/c/36352/ for each
command, we were setting api = identity or volume... etc,
this was for an old way of calling commands that are is no longer
used.
Also removed openstackclient/common/command.py
Change-Id: I2705f35d343f2ae729dc22d6aed0b852b2f8ca19
Basic cleanups:
* change metadata to property
* add new KeyValueAction to parse the property options
* multiple properties can be set using multiple --property args
* consistent formatting
* do lookups for volume args
Change-Id: Ib6c43f01ad46b395aee8c61e886f42e2a5f5573e
Now able to pass metadata to the create method,
as well as update it with set, and remove it with unset.
I'm currently passing it as an optional param like the following:
--meta-data=key1=value1
which seems weird, what about
--meta-data=key1:value1
I'd have to update type too if that is the case.
Change-Id: I0fc8398768da015c1f53c5c564c68a2cfb53e778
Again, looking thorouhgly through cinders commands, i noticed
an force-delete command, which was for volumes only.
Decided it would work best as an optional argument for the
regular delete case
Change-Id: I9de6040ea0ad71c2a9c8edc7be18779d39e7ede0