3864 Commits

Author SHA1 Message Date
Zuul
a103b6ca34 Merge "Use the SDK for server show" 2022-12-15 17:45:29 +00:00
Zuul
3f7663a00e Merge "Fix parameter handling in server add fixed ip cmd" 2022-12-15 17:45:27 +00:00
Zuul
3aff444386 Merge "Migrate hypervisor stats commands to SDK" 2022-12-15 17:45:23 +00:00
Zuul
240bbe7239 Merge "Create a functional test case for hypervisor list and show" 2022-12-15 17:45:19 +00:00
Thobias Salazar Trevisan
794334ec24 Fix server list error with --long and -c options
Using options --long and -c and specifying same columns added
by --long option, it passes duplicated column names to prettytable and
report the following error:

Field names must be unique!

This patch removes duplicated columns.

Change-Id: I9c0bd09c50dac568ca1980a6b53a6c544b85c2aa
2022-12-14 15:19:08 -03:00
Ariel-Berkowicz
318df521ed Create a functional test case for hypervisor list and show
This functional test case for hypervisor list and show makes sure it
works with the openstackclient sdk.

Change-Id: Ibaeaf68d6056fcf904b546f30287c65173b5a368
2022-12-14 16:50:42 +00:00
Stephen Finucane
b52ae93cd2 Fix functional-tips job
A recent change to cliff [1] means we're now stripping periods when
generating the summary line of command help strings. Account for this.

[1] https://review.opendev.org/c/openstack/cliff/+/867274

Change-Id: I45b39b9fe38914497505f157e91d84cd2f84f547
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-14 10:39:44 +00:00
Ariel-Berkowicz
992cfdfb57 Migrate hypervisor stats commands to SDK
Change-Id: I43b2071f5108c28f6881c8e99d4b06e87c83ddfa
2022-12-12 18:58:16 -05:00
Dr. Jens Harbott
f23322c5ef Fix parameter handling in server add fixed ip cmd
The fixed_ip_address parameter needs to be passed in a hash with key
"ip_address" in order to be processed by the server, the previous arg
was simply being ignored.

Added a functional test for better coverage.

Closes-Bug: 1998927

Change-Id: I6956d2642d8e80fc10c3739f0a571aa7ba276b1a
2022-12-12 12:27:48 -05:00
Daniel Wilson
70dbb01ea3 Use the SDK for server show
Use the SDK for the server show command. This change modifies a helper
function that is used by server show as well as other commands that
print information about an individual server. The helper still uses
novaclient APIs when additional OpenStack requests are needed since some
of its callers are still using the nova client.

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/864340
Change-Id: Ic253184ee5f911ec2052419d328260dc4664b273
2022-12-11 18:04:29 -05:00
Zuul
29129a7715 Merge "image: Add 'image import' command" 2022-12-05 12:59:52 +00:00
Zuul
8248efa8d9 Merge "compute: Allow users to manually specify bootable volumes" 2022-12-05 12:59:46 +00:00
Zuul
5b42583cb1 Merge "tests: Add test for multiple blocks devices" 2022-12-05 12:59:43 +00:00
Zuul
10453e085f Merge "Revert "Don't look up project by id if given id"" 2022-12-02 14:21:51 +00:00
Zuul
3cb4e9c714 Merge "tests: Convert network tests to use 'parse_output'" 2022-12-02 14:21:49 +00:00
Zuul
f9d2d69ed2 Merge "tests: Convert compute tests to use 'parse_output'" 2022-12-02 14:21:47 +00:00
Zuul
cc481f568b Merge "tests: Convert identity tests to use 'parse_output'" 2022-12-02 14:21:45 +00:00
Zuul
a5f207b657 Merge "tests: Convert volume tests to use 'parse_output'" 2022-12-02 14:21:43 +00:00
Zuul
5aecefe911 Merge "tests: Convert image tests to use 'parse_output'" 2022-12-02 14:21:40 +00:00
Zuul
70f05a6610 Merge "Use the compute SDK in server list" 2022-12-02 14:21:38 +00:00
Stephen Finucane
91277e7e51 compute: Allow users to manually specify bootable volumes
When creating a server with an attached volume, you can specify a block
device with a 'boot_index' of '0' and this will become the bootable
device. OSC allows users to do this by using either the '--volume'
option or a combination of the '--image' and '--boot-from-volume'
options, but we should also allow them to do it the "hard way" via the
'--block-device' option. For example:

  openstack server create \
    --block-device uuid=0a89ecd8-1fe2-45f0-94da-7789067911c9,boot_index=0 \
    --block-device uuid=589266ef-fd88-46e9-b7b2-94503ce8f88f,boot_index=1 \
    ... \
    my-server

Make this possible.

Change-Id: Ia48449fecbc590346630807b1c7da40102d53b33
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: 2010376
Task: 46617
2022-12-01 15:24:08 +00:00
Stephen Finucane
e7bc68735f tests: Add test for multiple blocks devices
The 'server create' command should support multiple '--block-device'
parameters. Prove it.

Change-Id: I1bd83287efdbbe11774053b694bae99b6a4ebdf5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-01 15:13:17 +00:00
Stephen Finucane
85254fbeb4 Revert "Don't look up project by id if given id"
This reverts commit 042be7c7fe89f5a1a190af90d5980205d995941b. This
solution worked but it was confusing. The issue that the author was
seeing was presumably due to users not being able to list projects but in
theory the 'openstackclient.image.common.find_project' function that was
being called here should have already handle this. It transpires however
that there was a bug in this and we weren't correctly handling HTTP 403
errors correctly. This bug has since been fixed in change
I2ea2def607ec5be112e42d53a1e660fef0cdd69c meaning this change is no
longer necessary. Remove it and simplify the code somewhat.

Change-Id: I108efec2c8deda50fcb9cc84f313602bed2ac15c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-30 12:35:17 +00:00
Daniel Wilson
c97f73ce2a Use the compute SDK in server list
Update server list to use the compute component of the OpenStack SDK
instead of directly using the nova interface. This change depends on SDK
version 0.102.0 for automatic client-side query filters.

Change-Id: Ib9985812bfd98320b75f3a82bb594a0daa6e4d93
2022-11-29 20:24:45 -05:00
Zuul
0a9533709f Merge "Improve server dump create helptext" 2022-11-29 20:52:23 +00:00
Zuul
6413b25dec Merge "Add note about microversion 2.87 in server rescue help" 2022-11-29 20:49:50 +00:00
Stephen Finucane
50aed3fea2 tests: Convert network tests to use 'parse_output'
Change-Id: I93e2a4e0a4c7ec07da0c78a171f3d787125af053
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-29 16:21:29 +00:00
Stephen Finucane
874519e980 tests: Convert compute tests to use 'parse_output'
Change-Id: Ib5b2f46639f14877a9ec295b26cae01a05395d4d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-29 16:21:29 +00:00
Stephen Finucane
6daa6be392 tests: Convert identity tests to use 'parse_output'
Change-Id: I10711b911986af0348946f6254cf36773110b0ab
2022-11-29 16:21:29 +00:00
Stephen Finucane
686fabef31 tests: Convert volume tests to use 'parse_output'
Change-Id: Iec8ca873f6bc3993e0ba557f68895d9aefb6f9c6
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-29 16:21:29 +00:00
Stephen Finucane
dc03ce98de tests: Convert image tests to use 'parse_output'
Change-Id: I5f256d466d503d70d1f380016f9c8f5a0d9e395f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-29 16:20:03 +00:00
whoami-rajat
4710cbeca6 Add test for creating volume from source
This patch adds a test to create a new volume from source.
We also include code changes to pass the right size i.e. either
size passed by the user via --size argument or the source volume
size. This case is already handled at the API layer[1] but it
helps being consistent with passing the right size value as in case
of creating a volume from snapshot or backup.

[1] 7c1a5ce7b1/cinder/api/v3/volumes.py (L381-L382)

Change-Id: Idc71636dad6bb678fe24f19b0836d2e9bd92d7d2
2022-11-23 14:20:06 +05:30
whoami-rajat
96162c24ea Change --size helptext to include backup
Followup from [1]. Modifying help text of --size
argument to include --backup option.

[1] https://review.opendev.org/c/openstack/python-openstackclient/+/864893

Change-Id: I12cf60079ebcfe1cd059602fbfc1a13c8fe86803
2022-11-22 21:20:19 +05:30
whoami-rajat
bd0727c4f8 Add option to create volume from backup
Support for creating a volume from backup was added in
microversio 3.47. This patch adds a --backup option
to the volume create command to add that support.

Change-Id: Ib26d2d335475d9aacbf77c0fd7b7cda2ba743943
2022-11-21 20:30:09 +05:30
Zuul
56b0f6de0e Merge "image: Add 'image stage' command" 2022-11-16 12:38:10 +00:00
Zuul
222ea8def2 Merge "image: Simplify handling of data provided via stdin" 2022-11-16 12:37:58 +00:00
Zuul
a2706f5a80 Merge "image: Ignore '--progress' if providing image data from stdin" 2022-11-16 12:27:47 +00:00
Zuul
e708ddc2a3 Merge "Moved hypervisor to the SDK" 2022-11-16 11:18:32 +00:00
Zuul
06afa9b8cf Merge "Use the compute SDK in usage commands" 2022-11-16 09:46:59 +00:00
Zuul
d09aef5a01 Merge "compute: Add missing microversion check for networks" 2022-11-16 09:43:55 +00:00
Zuul
16f18d4a80 Merge "compute: Fix '--network none/auto' handling" 2022-11-16 09:20:21 +00:00
Jadon Naas
348eb79632 Docstring fix for CreateVolumeAttachment class
The command "volume attachment create" has a typo in the docstring.
The docstring says to use "server add volume", but the command is
actually "server volume add". This
change fixes the typo in the docstring.

Task: 46781
Story: 2010401
Change-Id: Ie19a24ead100dd9177669653a7a9997772ef4538
2022-11-10 11:51:18 -05:00
Violet Kurtz
006e35509d Moved hypervisor to the SDK
Change-Id: Ie955fb4d27c30e044626732a1f3e0f141cb85aa5
2022-11-09 19:33:54 +00:00
Stephen Finucane
4eea3408dc image: Add 'image import' command
Note that we require some additional functionality in SDK for this to
work properly, but it's a start.

Change-Id: I87f94db6cced67f36f71685e791416f9eed16bd0
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-09 16:51:54 +00:00
Stephen Finucane
1fb8d1f48b image: Add 'image stage' command
This is the equivalent of the 'image-stage' glanceclient command.

Change-Id: I10b01ef145740a2f7ffe5a8c7ce0296df0ece0bd
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-09 16:51:54 +00:00
Stephen Finucane
3d9a9df935 image: Simplify handling of data provided via stdin
This was unnecessarily complex.

Change-Id: I8289d5ce7356d8bc89425590a7f71bca91a6d396
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-09 16:51:54 +00:00
Stephen Finucane
bafece762a image: Ignore '--progress' if providing image data from stdin
You can provide data via stdin when creating an image. Using this with
'--progress' makes no sense and causes an error currently. Fix this.

Change-Id: I3c2d658b72a7c62931b779b0d19bb97f60a0c655
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-09 16:51:54 +00:00
Stephen Finucane
38e39b6dc1 tests: Convert more functional tests to use 'parse_output'
Change-Id: I1d968181eb196c6df4583c772c67ed58bc7ba585
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-08 16:39:05 +00:00
Stephen Finucane
a244bb84e0 tests: Move json decoding to base test class
We do this everywhere. Add a simple knob to simplify the pattern. Only
one use is migrated initially. The rest will be done separately.

Change-Id: Ic3b8958bd4fb1459a8ac3adaff216c2a26628491
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-08 16:39:02 +00:00
Stephen Finucane
ffb69116b3 compute: Add missing microversion check for networks
The 'auto' and 'none' network allocation policies are only supported on
compute API microversion 2.37 or later. Enforce this in the code.

Change-Id: I90f8fb1e61ead4bd406ea76bbeb731b913805b13
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: 2010385
Task: 46657
2022-11-08 11:28:31 +00:00