182 Commits

Author SHA1 Message Date
Pedro Navarro
ee062922d1 Improving the help of the lock command.
The lock command allows you to block the actions
on the server for the non-admin users. Improving
the help so that api users understands better
what locking a server implies.

Change-Id: I925c946751602dc0f6bd1d31b514bc20bca585fa
Closes-Bug: #1366279
2015-02-01 13:15:49 -08:00
zhiyuan_cai
520b2f10cf Add 'find by name' to --nic for creating server
Add 'find by name' feature to --nic option for creating server.

Closes-Bug: #1353040
Change-Id: Idd0a30415d8360a57e33efedf2467593652683d4
2015-01-27 05:34:32 +00:00
Dean Troyer
bc11c4d7d8 Deprecate project usage list command
Rather than pointing the 'project usage list' entry point directly to
ListUsage, this makes a ListProjectUsage subclass to alias the desired
command and still allow for changing behaviour or issuing a deprecation
messages.  This implementation simply sets a new 'deprecated' attribute
in the command class that cliff will use to skip this command when
generating help output.

The actual skipping of the command in help output is dependant on
https://review.openstack.org/147349 merging in cliff, this review will
simply have no effect on help output until a version of cliff with
that update is present.

The deprecation message printed is somewhat generic until
https://review.openstack.org/147381 is merged in cliff.
Until that is merged, the deprecation message will not have the name
of the actual command given by the user in it, but rather the text
'this command'.

Closes-bug: #1406654
Change-Id: Ie08d4f88d71a660fca1862405351109cd0aa86b6
2015-01-15 00:04:55 -06:00
Steve Martinelli
019c155e9b Fine tune some of the helps commands
try and add some consistency with the show and delete commands.

replace 'show x' with 'display x'
change 'delete a y' with just 'delete y'

Change-Id: I47dfa8ee23ac5c41b355796415eb515155832f65
2015-01-13 00:58:57 -05:00
Jenkins
8132072630 Merge "Add docs for usage show/list" 2015-01-02 17:54:30 +00:00
Steve Martinelli
480921d0e8 Add docs for usage show/list
Change-Id: Iaf911d69a0b63d705f8789a4640018a428b87be6
2014-12-31 14:21:48 -05:00
Dean Troyer
0720c78199 Command docs: flavor
Change-Id: Ie85ff7706ef08b70ab8ba99533465d90904cf393
2014-12-31 12:09:50 -06:00
Steve Martinelli
caef59a4a8 Add docs for listing availability zones
Change-Id: I4c005e1d8089b46feca6cd3266f63c408648f074
2014-12-31 02:54:36 -05:00
Jenkins
50a8377969 Merge "list availability zones for compute" 2014-12-31 01:54:05 +00:00
Jenkins
5206278992 Merge "Add usage show command" 2014-12-31 00:02:11 +00:00
Jenkins
95313d0a2d Merge "Fix a few issues with 'usage list'" 2014-12-31 00:02:04 +00:00
Steve Martinelli
5761a0f0b7 Add usage show command
Should show basic usage by project id, if not specified then
use the project id the user is authN'ing with.

Change-Id: I0284a5efd84075b18e1a7117cc9f8f7fecf16274
Closes-Bug: #1400796
2014-12-26 03:25:51 -05:00
Steve Martinelli
6e3c9a3d2d Fix a few issues with 'usage list'
* Added number of servers column, was missing
* Added a new line character after the initial usage message

Change-Id: I6c4e5bda6ba9ceafa92ecf13987c56d0bbe99961
2014-12-26 03:23:10 -05:00
Terry Howe
1927b03cc7 Compute calls ignore region selection
Calls to compute commands ignore region selection.  The region is
not passed to the get_endpoint call.

Change-Id: I1ccfc56d7cb27a00b8982232a40ace21f2c0e9a2
Closes-Bug: 1405416
2014-12-24 06:08:19 -07:00
wanghong
470b7e53a8 add multi-delete support for compute/image/net/volume
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
2014-12-23 09:31:10 +08:00
Jamie Lennox
25a7c1f27f Don't import form keystoneclient.openstack.common
The keystoneclient.openstack.common directory is where we sync files
from oslo incubator. It is not a public directory and should not be
being consumed by openstackclient.

Change-Id: I011bb95c2c824e2dbc4b822ca922ae77b8d9b955
2014-12-17 18:17:56 +10:00
Steve Martinelli
381b47ff05 list availability zones for compute
Adds the command `os availability zone list`

Change-Id: I77bf52a9b84a62c3771a4838c9ea0c3af03eedb2
Closes-Bug: #1400795
2014-12-16 23:00:52 -05:00
Dean Troyer
ac4950b46e Command object docs: server, server image
server
server image

Some cosmetic changes in the command source, sorting classes, help strings, etc.

Change-Id: I3f68dae77b9fe02bc6866684e05aeff943dd9cc3
2014-12-03 13:34:44 -06:00
Jenkins
7e6b68ded9 Merge "Command object docs: aggregate, console *, keypair" 2014-12-01 22:32:35 +00: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
2b02beaa51 Liberalize version matching a bit
For class-loading purposes we can just use the major version,
so accept that. Only Identity and Compute were affected; Compute
is included just to be pedantically complete.

For command groups we also just use the major version so fix
Compute and the version option handling.

Change the internal default for Identity to a simple '2' so it
is also consistent with the rest of the world.

Then comes microversioning...

Closes-Bug: #1292638
Change-Id: Ibaf823b31caa288a83de38d2c258860b128b87d8
2014-11-16 11:37:52 -06:00
Dean Troyer
2c9d263611 Fix server create for boot-from-volume
* server create required --image even when booting the server from a
  volume.  Change options to require either --image or --volume to
  specify the server boot disk.  Using --volume currently uses device
  'vda' for the block mapping and ignores any other block mappings
  given in --block-device-mapping.
* server create and server show are both affected by bug 1378842 where
  an excepion was thrown when no image ID was present in the returned
  server object, which is the case for a server booted from a volume.
* Fix the remaining assertEqual() order problems in test_server.py

Closes-Bug: 1378842
Closes-Bug: 1383338
Change-Id: I5daebf4e50a765d4920088dfead95b6295af6a4d
2014-10-24 17:55:44 -05:00
Jenkins
d140d8940f Merge "Close files on server create, add tests" 2014-10-24 16:12:06 +00:00
Dean Troyer
0de67016c7 Remove now-unnecessary client creation hacks
Clients that can use ksc Session don't need the old junk to
fake auth anymore:
* compute
* volume

Clients that still need to be fed credentials can pick directly
from the auth object in clientmanager.  The _token attribute is
removed, the token can be retrieved from the auth object:

  openstackclient/tests/common/test_clientmanager.py

This change will break any plugin that relies on getting a token
from instance._token. They should be updated to use the above, or
preferable, to use keystoneclient.session.Session to create its
HTTP interface object.

Change-Id: I877a29de97a42f85f12a14c274fc003e6fba5135
2014-10-18 00:01:45 -05:00
Jenkins
68130fa921 Merge "Add plugin to support token-endpoint auth" 2014-10-17 23:27:28 +00:00
Dean Troyer
89217a6557 Close files on server create, add tests
The files opened for the --files and --user-data options were never
closed, potentially leaking memory in a long-running client. Close
them if they are file objects.

Add a couple of basic tests for server create.

Change-Id: I1658b0caa2d6af17308149cb52196ee28266ddf2
2014-10-14 15:45:20 -05:00
Jenkins
87f5da02c3 Merge "Fix operation on clouds with availability-zones" 2014-10-14 04:11:24 +00:00
Dean Troyer
c3c6edbe8a Add plugin to support token-endpoint auth
The ksc auth plugins do not have support for the original
token-endpoint (aka token flow) auth where the user supplies
a token (possibly the Keystone admin_token) and an API endpoint.
This is used for bootstrapping Keystone but also has other uses
when a scoped user token is provided.

The api.auth:TokenEndpoint class is required to provide the
same interface methods so all of the special-case code branches
to support token-endpoint can be removed.

Some additional cleanups related to ClientManager and creating
the Compute client also were done to streamline using sessions.

Change-Id: I1a6059afa845a591eff92567ca346c09010a93af
2014-10-12 16:48:43 -05:00
Monty Taylor
3af547a1a6 Fix operation on clouds with availability-zones
In a cloud with AZs, you can get multiple entries back from the service
catalog - one for each AZ and then one that is AZ agnostic that's tied
to the region. If the region_name is plumbed all the way through, this
works as intended.

Change-Id: I3b365ea306e8111fc80830672ae8080a5d1dc8e0
2014-10-11 14:30:04 -07:00
Steve Martinelli
111d43ad8f Update compute server messages for translation
Mark some of the messages from the server for translation

implements bp use_i18n

Change-Id: I503efcfb4ca3dec1c427b58ee4a85de9a241dacd
2014-10-08 15:05:22 -04:00
Jenkins
34c8bdaf35 Merge "Fix security group list for non-admin" 2014-09-06 17:02:42 +00:00
Jenkins
8cfc8529be Merge "Fix server add security group" 2014-09-06 16:09:30 +00:00
Dean Troyer
22c544a822 Fix server add security group
The group resource was being passed when only the name is needed.

Change-Id: Ia303804be4e336f9880205d931467cb831e812de
2014-08-27 17:35:30 -05:00
Dean Troyer
e19216e282 Fix security group list for non-admin
Non-admin users couldn't list security groups due to the project lookup
failure.  That shouldn't stop the listing.

Change-Id: I27f6ff4975b35d1de1c852c8d4e830b83c7dec75
2014-08-27 17:19:53 -05:00
Jenkins
97d1bbdafd Merge "Create message variables for exceptions" 2014-08-24 20:20:08 +00:00
Steve Martinelli
c2b0cec6e3 Create message variables for exceptions
Instead of inline messages, let's create variables instead, as
it's easier to find strings, and mark them for translation.

Change-Id: Ibbcfdbc59d12a0cb4af50f73043d3ff7f3c76f99
2014-08-24 18:16:07 +00:00
Jenkins
e0cf68f995 Merge "Normalize more help strings" 2014-07-24 22:09:28 +00:00
Dean Troyer
5bb6c72ef7 Normalize more help strings
Change-Id: I2b21bc904e35c1cc50da369d148e607fe3e8cf90
2014-07-24 11:22:29 -05:00
Jenkins
5830007bbc Merge "Fix server resize" 2014-07-12 20:58:37 +00:00
Jenkins
bc6495c6a1 Merge "Add basic timing support" 2014-07-11 18:22:06 +00:00
Dean Troyer
ea2ac77a46 Fix server resize
So apparently we've never resized a server???

Fixed command args and add some tests.

Change-Id: I6c3f6fec22390e9d269b7117a42a190d2b4b80ba
2014-07-08 11:20:13 -05:00
Jenkins
69138c7912 Merge "Clean up make_client() logging" 2014-07-08 15:48:28 +00:00
Dean Troyer
4844a25779 Add basic timing support
Add support for --timing options.  Use cliff via a pseudo-command
'Timing' to support multiple outputformats.

If an output format other than the default 'table' is selected
use CSV since the timing data is in list form.

Will pick up timing data for any client object that has a method
similar to novaclient's get_timings().

TODO:
* Stop instantiating all of the clientmanager client objects just
  to check for timing data.  Descriptor magic required?

Change-Id: I7f1076b7a250fba6a8b24b2ae9353a7f51b792b2
2014-07-08 02:04:00 -05:00
Dean Troyer
21bd4619ae Clean up make_client() logging
Change-Id: I0b6760a6401b50e3dfb891af75424ae89df42ebc
2014-07-08 01:44:55 -05:00
Steve Martinelli
270c7fe967 Add support to list compute extensions
Since novaclient has support to list extensions, we should add
some of the logic to our list extensions command.

Closes-Bug: #1337684
Change-Id: I3074225780142df265a34add03e60c0f7c64c711
2014-07-03 23:53:57 -04:00
Dean Troyer
11f3654f6e Fix PEP8 E265 errors
Change-Id: Ieb9a9af1da27d3935d1a4d3cfb61b0ccb03d099a
2014-06-27 09:12:55 -05:00
Dean Troyer
0059f045a9 Ignore most of the new hacking 0.9.2 rules
So we can update requriements.txt.  But fix a couple of easy ones:
* Fix E251 (1 occurrance)
* Fix E131 (1 occurrance)

Change-Id: I62aaa423aa6da9e9f0ca026ec586b51cc6a6df03
2014-06-13 17:06:28 -05:00
Jenkins
3b925e9806 Merge "replace string format arguments with function parameters" 2014-06-10 02:27:54 +00:00
Jenkins
7ceff0eafc Merge "Fix server image create" 2014-05-28 22:05:53 +00: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