27 Commits

Author SHA1 Message Date
Dean Troyer
1686dc54f0 Help/docs cleanups: marker, limit, ip-address metavars
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
2017-04-04 03:56:19 +00:00
Jenkins
e05c8d7bb0 Merge "Refactor "snapshot" commands" 2016-12-03 04:30:51 +00:00
Steve Martinelli
0ef8535036 translate all command help strings
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
2016-11-17 02:33:42 +00:00
Huanxuan Ao
23ee2fd8f0 Refactor "snapshot" commands
1.change the command name ``snapshot create/delete/list/
show/set/unset`` to ``volume snapshot create/delete/list/
show/set/unset``.

2.change the optional parameter "--name <name>" to a
positional parameter "<snapshot-name>"; Change the
positional parameter "<volume>" to a optional
parameter "--volume <volume>"

Change-Id: If03276ecdf6f0d96893d5ecf91c2aaa64929cff3
Implements: bp backup-snapshot-renamed-for-volume-resource
Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com>
2016-11-03 16:15:02 +08:00
Huanxuan Ao
3ebc7520a6 Add warning message for --state option of set command in volume
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
2016-09-26 02:42:47 +00:00
Huanxuan Ao
10e665a148 Error handling of multi REST API calls for "snapshot set" command
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
2016-09-11 11:41:05 +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
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
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
Huanxuan Ao
8aa00894ef Remove useless dest of option in "snapshot create" command
The option is '--force' and the default argument is
'force', so the 'dest=force' is useless and unnecessary.
This patch remove it.

Change-Id: If8fd5270e4e36b5361127f4a91bdf347f29341c2
2016-07-04 16:46:28 +08:00
Dean Troyer
9e2b8e6730 osc-lib: command
Leave command.py and test_command.py as a sanity check during the
deprecation period.

Change-Id: I24e1b755cbfbcbcaeb5273ec0c9706b82384fc85
2016-06-13 11:00:22 -05:00
Dean Troyer
be192676bd osc-lib: parseractions
Leave parseractions.py and test_parseractions.py as a sanity check during the
deprecation period.

Change-Id: I1a7469b6d872284e0276502a1a287bc0b87f8f83
2016-06-13 10:55:44 -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
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
Huanxuan Ao
7def236718 Fix i18n support in cinder
I checked all the cinder files and found some small issues
of i18n support.So I fix them.

Change-Id: I2df06cb9db4643bd734105664d83299726f7b4e9
Partial-bug: #1574965
2016-05-30 17:00:35 +08:00
Sheel Rana
53e05e7c2d i18n support for help and error messages in cinder
Change-Id: I98fbc959034fe0530966291643b381855801de20
2016-05-23 18:04:36 +00:00
Jenkins
7a0845ec11 Merge "Add support of setting snapshot state" 2016-05-18 16:49:07 +00:00
Tang Chen
46decfbd7a Trivial: Fix incorrect comment text
Change-Id: Ia6ec15f11a535a8de5769569d75e81094caed171
2016-04-14 17:21:53 +08:00
Tang Chen
32c627eaf0 Doc: Unify repeatable option comments
There are lots of "this option can be repeated" comments
in the doc, which are not consistent to other similar
docs.

This patch changes them to the following format:

"repeat option to do something"

Change-Id: I54e01053091c428bf87bb36bb95f73a0b80ab6e7
2016-04-12 15:57:17 +08:00
Ivan Kolodyazhny
311e775c81 Make snapshot and backup name optional
Cinder does not require snapshot and backup name. These arguments are
optional.

Change-Id: I05d59efc9642205a25684bf0b77758328296d959
2016-04-06 23:25:38 +03:00
Xi Yang
189e4774f8 Add support of setting snapshot state
This patch is going to add the functionality of
setting snapshot state which OSC currently lacks.

Closes-Bug:#1535239
Change-Id: I2afd6567416e75ba0c70b73351cf1eb5394b3373
2016-03-09 00:13:55 +08:00
Akihiro Motoki
258c1102cc log take_action parameters in a single place
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
2016-02-02 09:58:32 +09:00
Tang Chen
f552302b61 Trivial: Remove useless return from files in image and volume
Change-Id: I3526ecd202d0908d91305a066ad72d03cee794b5
2015-12-18 23:25:05 +08:00
Jean-Philippe Evrard
9168373b3d Consistency of the --all argument for snapshots
This change is inspired by the volume.py.
It allow the user to use openstack snapshot list --all.

Closes-Bug: #1517386

Change-Id: I72a53fcd0c5c5af539cd88b37e71b4331fa67473
2015-11-30 12:54:19 +00:00
Joshua Harlow
e3c46ece4a Use a common decorator to log 'take_action' activation
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
2015-09-01 16:49:54 -07:00
Amey Bhide
c88b433abb Add support for volume snapshot v2 command
openstack snapshot create
openstack snapshot set
openstack snapshot unset
openstack snapshot list

Implements: blueprint volume-v2
Change-Id: Ia1d9f4426baa0099281a9931f4eec99ebe1969b1
2015-06-04 20:13:19 +00:00
Amey Bhide
5361652d8f Add support for volume v2 API
Added following commands for volume V2 API:
volume show
volume delete
volume type show
volume type delete
snapshot show
snapshot delete
backup show
backup delete

Implements: blueprint volume-v2
Change-Id: I68bd303c194f304ad15f899d335b72a8bf3ebe10
2015-05-30 11:26:14 -07:00