40 Commits

Author SHA1 Message Date
Matt Riedemann
1557afb554 Document 2.53 behavior for compute service list/delete
With compute API microversion 2.53, nova-compute services
can only be deleted with the ID as a UUID to uniquely identify
the service in a multi-cell deployment. This documents that for
the "compute service delete <service>" argument. The description
of the "compute service list" command is also updated to mention
that the ID can be retrieved as a UUID using 2.53 or greater.

Change-Id: If7d4a27c0aaef588bcd77dd9edddec1e535fbf31
Story: 2005349
Task: 30302
2019-08-20 15:38:59 +00:00
Matt Riedemann
4bd53dc109 Fix compute service set handling for 2.53+
With compute API microversion 2.53 there is a single
PUT /os-services/{service_id} API which takes the service
id as a UUID. Since the openstack compute service set
command only takes --host and --service (binary) to identify
the service, this change checks if 2.53 or greater is being
used and if so, looks up the service by host and binary and
calls the appropriate methods in novaclient.

If the command cannot uniquely identify a compute service
with the given host and binary, an error is raised. A future
change could add an --id option to be used with 2.53+ to
pass the service id (as UUID) directly to avoid the host/binary
filtering.

Change-Id: I868e0868e8eb17e7e34eef3d2d58dceedd29c2b0
Story: 2005349
Task: 30302
2019-08-09 16:00:13 +00:00
Matt Riedemann
b52a831f6b Mention compute service set --up|--down requires 2.11 or greater
This simply updates the docs for the compute service set --up
and --down options to mention that --os-compute-api-version 2.11
or greater is required to use those options.

Change-Id: I52891fe36c84d0df3e868ab4f3c8e2357e9ba529
2019-07-24 12:03:01 -04:00
Matt Riedemann
879f820778 docs: clarify compute service --service option
The compute service commands emit a "Binary" in the output but
the --service filter option isn't as clear that it's the binary
(for set it is but not list) nor do the docs give an example
of a binary (typically nova-compute but could be others like
nova-conductor, nova-scheduler, etc). This simply mentions that
the --service option is the binary for "compute service list"
and gives an example value for the option in both list and set
help.

Change-Id: If87fc37352c3a251cc89041723adbe04dedf4f8a
2019-07-01 15:06:56 -04:00
He Jie Xu
956eabe967 compute: limit the service's force down command above 2.10
The force down action is added in Microversion 2.11, we should limit
the command only can be executed when the microversion is above 2.10.

Change-Id: I0a87e02e71ff025d30181fc17ebcd003a590f110
2018-06-19 12:59:03 +00:00
David Rabel
e8b56a37cc Corrected spelling mistake
in quotas -> in quotes

Change-Id: I3adb1ccd8f3a9c495f0b9cf688aee5c4c1e63507
2018-01-19 11:18:41 +01:00
yfzhao
535def3447 Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

Change-Id: I504de69b2e64250740ebcab432042a16f966fdbe
Closes-Bug: #1674584
2017-03-21 17:23:09 +08:00
Gábor Antal
1c91e9828d Handle log message interpolation by the logger in compute/
According to OpenStack Guideline[1], logged string message should be
interpolated by the logger.

[1]: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages

Change-Id: Ib7b5fb5f794026fc8a84260c4803afea321a9cf5
Closes-Bug: #1596829
2017-02-13 18:43:12 +01: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
Jenkins
21ad61ddd9 Merge "Support bulk deletion for delete commands in computev2" 2016-06-28 08:24:36 +00:00
Huanxuan Ao
af7ab03693 Support bulk deletion for delete commands in computev2
Support bulk deletion and error handling for "keypair delete"
and "service delete" commands in computev2.
Up to now, all the delete commands in computev2 support bulk
deletion.

Change-Id: I6d5c960e9716188e56615514d0921618a15a88ec
Partially-Implements: blueprint multi-argument-compute
Partial-Bug: #1592906
2016-06-27 20:39:23 +00:00
Huanxuan Ao
c7b137e421 Modify some unusual help messages in computev2
Some command help messages are unusual, for example:
common help message for a list command:
"list objects"
unusual help message:
"list obejcets command"
I think we should keep help message consistent, so I modify
the unusual help messages in computev2.

Change-Id: Ic5f11eba1a4397949e85d91cc067519752e89bff
2016-06-27 15:27:34 +08:00
Huanxuan Ao
70f8ae7534 Refactor unit test of "compute service list" command
The unit test of "compute service list" only checked the
"Disabled Reason" columns and its data. It is not enough.
This patch change the test to check all datas in the list.

Also, this patch modify the "Id" to "ID" in this command.

Change-Id: I988fd6365f2652185dd96d9417f294eba9c31cd9
2016-06-22 19:02:39 +08:00
Tang Chen
047cb68493 Standardize logger usage
Use file logger for all command specific logs.

This patch also fixes some usage that doesn't
follow rules in:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html

After this patch, all self.log and self.app.log
will be standardized to LOG().

NOTE: In shell.py, we got the log in class OpenStackShell,
      which is also known as self.app.log in other classes.
      This logger is used to record non-command-specific logs.
      So we leave it as-is.

Change-Id: I114f73ee6c7e84593d71e724bc1ad00d343c1896
Implements: blueprint log-usage
2016-06-20 15:16:51 +00:00
Jenkins
4cc539fcc5 Merge "Support compute service force down/up" 2016-06-15 16:36:30 +00:00
Dean Troyer
6357202971 Fix foundation copyrights
The OpenStack LLC copyrights date from before OpenStack was transferred
to the foundation.  These appear to be getting copy-pasted to new files
so at least should reflect the correct entity.

Change-Id: I02953d752cb24ead6aa4ad8bfe257a48317c9f13
2016-06-14 09:49:28 -05:00
Rui Chen
eccd943acc Support compute service force down/up
Aims to evacuate servers from compute host as soon as possible,
operators might set the compute service force down manually.
Novaclient support the behavior, this patch support it in OSC.

Change-Id: I22ff1c5d670c449771fdcb3f4f39cd82f428531a
Closes-Bug: #1589348
2016-06-14 17:40:09 +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
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
Jenkins
84506a6b71 Merge "Fix compute service set command" 2016-06-08 05:03:47 +00:00
sunyajing
565499577f Fix compute service set command
add ``Binary name`` to help msg of compute service set command.

Change-Id: I5ed3824ec5bede250ce41f187835e8901b5e11fd
2016-06-08 03:07:16 +00:00
Tang Chen
ac1d86c343 Refactor SetService --enable/disable option
This patch changes the following:

1. --enable/disable option should follow the rules
   in the doc below:
   http://docs.openstack.org/developer/python-openstackclient/command-options.html#boolean-options

2. "--disable-resion" is specified but not "--disable",
   an exception is raised instead of igoring
   "--disable-reason" option.

Change-Id: I92e9234111e661bfe7119a8e19389a87c874ab0c
2016-06-04 22:42:46 +08:00
Tang Chen
5398c96e2a Fix i18n support for help and error messages in compute
Change-Id: Id6eebcb48d1b7b49b6636524506294edbc44a83f
Partial-bug: #1574965
2016-05-24 11:03:49 +08:00
Steve Martinelli
ebcbd6ba71 remove #noqa from i18n imports
hacking checks no longer fail on `import _`

Change-Id: Idd60f0a0e71e5081691eacb39e5091ab08fcce6d
2016-05-13 13:14:02 -07:00
Rui Chen
4d3f996e7c Log hint when --enable present with --disable-reason
--enable and --disable-reason should be mutually exclusive in "compute
service set" command, but now when they are present at the same time,
--disable-reason would be ignored silently. Fix these and add some hints
about --disable-reason argument is ignored in this situation.

Change-Id: I43254b6bc40fcae4fd0dc3457f26fad84c267072
Closes-Bug: #1556801
2016-04-05 21:22:27 +08:00
Sheel Rana
63c57eb56e Wrong param type in compute-service.rst
compute-service.rst file uses 'describe' for below
optional parameters

1. --long
2. --service <service>
3. --host <host>

This patchset changes type of these argument to option.

Change-Id: Ifd57bdf058efaeaa6cb43a7d4a60ee61ddb8de14
Closes-bug:#1563700
2016-03-30 14:45:41 +00:00
Rui Chen
8664a2f8ae Support "--long" option in ListService
Add "--long" option in ListService so that compute service
disabled reason can be showed.

Change-Id: I1ace8f1c4e4efe0a1a8f6710425d73eb5db9e5e1
Closes-Bug: #1556815
2016-03-14 18:07:23 +08:00
jichenjc
b711c3a0ca Add --reason for disable service
disbale service allow a reason to be input as disable reason.
This patch add support for it.

Change-Id: I59622c3970e055ebd46bf03c33c864b6d064db28
2016-03-09 05:19:41 +00: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
Rushi Agrawal
eeeb9f729f Docstring should say 'default' if option is default
Change-Id: I59d83e7a0a590fa537f509f7f19940640f555679
2015-12-31 09:36:26 +05:30
Jenkins
b220f4b667 Merge "Remove list output from "compute service set"" 2015-12-18 21:40:22 +00:00
Tang Chen
494659fbe4 Trivial: Remove useless return from files in compute.
Change-Id: I9dc6749256fcd53d292d7f658912c032e9ce9df5
2015-12-17 09:34:12 +08:00
xiexs
fad7126e79 Remove list output from "compute service set"
Replace the super class from lister.Lister to command.Command,
as no need to display the status for the "set" command.

Change-Id: Ibaf3c1e349633223fca19937bbd9060d4f9ecbda
Closes-Bug: #1517804
2015-12-01 06:18:13 +00:00
Alex Schultz
d1bc15f498 Add compute service delete
This change adds 'compute service delete <service>' to the openstack
client. This is the equivalent of 'nova service-delete <id>'

Change-Id: I69ef1cac72cbe125c2114f8e958e22350a70f367
Closes-Bug: #1503510
2015-10-16 14:01:37 +00:00
Alex Schultz
80e3a2dedb Add ID column to compute service list
This change adds the ID to the compute service list command so that the
ID can be leveraged by scripts trying to remove or update a specific
service.

Change-Id: I446b4c0071988133195eb2382313b3918b7ffa72
Closes-Bug: #1503430
2015-10-06 16:00:59 -05:00
Christian Berendt
3b485de6b0 replace string format arguments with function parameters
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.

Change-Id: Ic749ac9eb55564ed631d57055a5a4dfc3aebd169
2014-05-20 13:49:56 +02:00
Steve Martinelli
1a0d5ccc68 Remove api = apiName calls from each method
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
2013-07-12 11:07:33 -05:00
Josh Kearney
f54012cf8e Removed unused imports.
Change-Id: Ib1bae16f996559c008fb1fe0b74f26b152854ea8
2013-03-15 11:10:46 -05:00
Josh Kearney
7266c695b3 Added compute service support.
Change-Id: I548e35396534b5498f31a45c752984f6d33357c3
2013-03-05 10:30:36 -06:00