21 Commits

Author SHA1 Message Date
Thomas Goirand
9a17356854 Fix crashing "console log show"
Because of encoding issue, the "openstack console show log" is prone to
a stack dump, as explained in the bug report.

Use the stdout handle that has already been set up by cliff's App class
with a sane default encoding.

Change-Id: I4d8b0df7f16ee0463e638bb11276220e5b92023b
Closes-Bug: 1747862
2018-03-16 11:30:51 -05:00
huangtianhua
f891b6862f Use public and unified method get_console_url()
Novaclient has provided a public and unified method
get_console_url() to get console urls of server.
This change switches to use it.

Change-Id: Ie6b9d8cfc57a6943b5d64a4064e4bdd372cd8cd3
Depends-on: I36c6209b17ef453e1c2e47841daf41f81af471dc
Closes-Bug: #1654913
2017-02-14 03:22:03 +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
Rui Chen
cf20225347 Support to get server rdp/serial/mks type console url
The patch add the support to get server rdp/serial/mks
type console url, that make osc capability equal with
current nova server side feature.

Change-Id: I3dee2531c68563725187c8251d5ea8d4c02cca0c
Closes-Bug: #1605088
2016-07-21 15:43:01 +08:00
zhengsenyan
1e895f3286 fix one spelling mistake and two help messages
I checked all the 70 rst files in doc/source/command-objects and
found that:
 -one spelling mistake as:rescure should be rescue(server.rst)
 -two help messages:xpvnc should be xvpvnc(console-url.rst and
  console.py)

Change-Id: I6f46c79983eaf5650bd3aa0ab448c19f5c6527a9
2016-07-07 14:19:04 +08:00
Rui Chen
8cceaddaac Fix console url show command broken in microversion case
The response data of nova get_xxx_console API is changed
from "console" to "remote_console" in microversion 2.6, and nova
server side API schema verify the spice vnc type to "spice-html5",
update OSC code to apply these change so that OSC can work in
different nova microversion cases.

Change-Id: I3bb4fe057e656209d00d2bb308ac3f7f837cb03f
Closes-Bug: #1590318
2016-06-16 21:13:47 +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
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
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
494659fbe4 Trivial: Remove useless return from files in compute.
Change-Id: I9dc6749256fcd53d292d7f658912c032e9ce9df5
2015-12-17 09:34:12 +08:00
xiexs
ea63553925 Fix the bug of "openstack console log show"
The behaviors are inconsistent while different
negative line numbers specified.

Change-Id: I2573f3e789f5603c896758971830ffc0b94c5e2b
Closes-Bug: #1512263
2015-11-09 04:22:09 -05: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
Dean Troyer
9eb30efbf3 Command object docs: aggregate, console *, keypair
aggregate
console log
console url
keypair

Change-Id: Iec9b8404ed5febd061a5dfd674b76aaa8aba67bc
2014-11-19 14:47:53 -06:00
Dean Troyer
5bb6c72ef7 Normalize more help strings
Change-Id: I2b21bc904e35c1cc50da369d148e607fe3e8cf90
2014-07-24 11:22:29 -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
Yejia Xu
3b57117f8e Display all server log when --lines option is None
Without --lines option, `console log show xxx`
cmd will break.

Change-Id: I4027aacac245e6916c1808fd9f878fb708c8a5f0
Closes-Bug: #1316870
2014-05-07 05:15:22 +00:00
Dean Troyer
dfb0e3e3c1 Begin Python 3 compatability
* 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
2013-07-29 19:12:29 -05: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
Dean Troyer
53bbff67eb Add console commands
Adds:
* console-log
* console-url

Part of blueprint nova-client

Change-Id: Ibea7f96382283770988d05379d41a148f8cd8c4f
2013-04-25 14:36:46 -05:00