5252 Commits

Author SHA1 Message Date
melanie witt
72a2477ec0 Fix 'server event list|show' for deleted servers
As of compute microversion >= 2.21, support for list and show of server
events for deleted servers was added. This however wasn't working using
the openstackclient because the compute GET /servers/{server_id} will
not return a deleted server, so osc_lib.utils.find_resource() fails to
find the server and the command bails early.

This adds a check for a uuid-like <server> arg and uses it directly if
the <server> cannot be found via find_resource().

A note is also added to the command help to indicate that list and show
for deleted servers will only work if a server ID is passed (name will
not work).

Story: 2009841
Task: 44443

Change-Id: Icd33b3b9a3a1855d7893dd111bbb2aca059f45fd
2022-02-09 23:26:25 +00:00
Zuul
27843fc232 Merge "Add missing command mapping in nova" 2022-02-09 12:50:18 +00:00
Zuul
5f73c527ee Merge "Support Neutron Local IP CRUD" 2022-02-09 12:50:15 +00:00
Zuul
e000fd5f0d Merge "Add network update quota "limit_check" parameter" 2022-02-03 15:53:02 +00:00
Dr. Jens Harbott
746b91335c Don't fail on extlinks warnings for reno build
With Sphinx==4.4.0 some "helpful" warnings were introduced when an
external link could be replaced by a macro, like for :lpbug:. Sadly we
have a very high number of existing release notes that trigger these
warnings and no good way to fix them retrospectively, because would mess
up their mapping to releases. So we change the logging for the
sphinx.ext.extlinks to ignore these warnings for now.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I709de5e454434b8790a68d9e67ca1432387b21ab
2022-02-03 12:19:27 +01:00
Nurmatov Mamatisa
26144743d9 Support Neutron Local IP CRUD
Add support for Neutron Local IP CRUD operations.

Partial-Bug: #1930200
Depends-On: https://review.opendev.org/c/openstack/neutron/+/804523
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/804988
Change-Id: I1095100efb27b8559412469f0a9d07fc0a3db9d5
2022-01-28 17:24:04 +03:00
Zuul
f00dce9e2f Merge "Get rid of tenant_id in the network commands" 2022-01-17 17:39:20 +00:00
Zuul
7c7a30b3cd Merge "Skip original_name from flavor info" 2022-01-17 09:28:37 +00:00
Artem Goncharov
18dcd7c9f7 Get rid of tenant_id in the network commands
Finally drop tenant_id completely from the networking service.

Change-Id: I5f62f2a76592eaaaed6703624e959df41a6ecc8f
2022-01-17 09:31:16 +01:00
Ritvik Vinodkumar
b5a2714b83 Switch compute service list, delete and set to sdk.
Switch the compute service commands from novaclient to SDK.

Change-Id: I16498905101d6c2702a3ccbaf8cf5e3098d51992
2022-01-14 18:36:37 +00:00
Artem Goncharov
f461af0ac8 Skip original_name from flavor info
In the new SDK we are going to add additional parameter to the flavor
which make no use for OSC. Exclude it explicitly since it also cause
failing tests.

Change-Id: Ie35e60498cf18f05c878611df6f88607a04b1870
2022-01-14 17:37:59 +01:00
Zuul
0a887a4786 Merge "Add --security-group to port list" 2022-01-13 20:13:30 +00:00
Dr. Jens Harbott
f533dca520 Fix volume set functional test
Sometimes it can happen that when extending a volume it is shown as
status "extending" with the original size for a while. Wait for the
volume to enter state "available" again before checking the result.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: Ib70cfa1c241ce94426214c7a05c550213f427caa
2022-01-11 07:24:48 +01:00
Zuul
b79c0b6cfb Merge "Include hosts in aggregate list --long" 2021-12-25 10:54:27 +00:00
Zuul
eb139f6fe8 Merge "compute: Return information about fixed IP" 2021-12-25 10:54:24 +00:00
Zuul
9b49363c0d Merge "Switch add fixed IP to SDK" 2021-12-25 10:54:22 +00:00
Zuul
6a0187d47c Merge "compute: Pass through args to ssh" 2021-12-25 10:54:20 +00:00
Zuul
ba935590f4 Merge "compute: Fix weird option definition for 'server ssh'" 2021-12-25 10:54:18 +00:00
Dr. Jens Harbott
724852e66e Add location to fake network objects
Network objects returned from the SDK include a location column which
has a reference to the cloud to which the object belongs. Add this
column to our fake objects used for testing, so that we can make sure we
don't include them in CLI output where they are useless.

Change-Id: Ib09027af78e7bf2458cdc76ea9027faa3dbbfcf9
Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
2021-12-16 19:33:29 +00:00
Dr. Jens Harbott
90eb0ca4bb Hide location columns for network objects
Network objects returned from the SDK include a location column which
has a reference to the cloud to which the object belongs. We don't want
to include them in CLI output where they are useless.
The solution implemented in [0] was dropped as a sideeffect in [1].

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

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I9a408d9721c9c57d752afaab520cd6ee379a5184
2021-12-16 19:33:04 +00:00
Hugh Saunders
3a929611c0 compute: Pass through args to ssh
Why limit a user to preset ssh arguments? Capture them all and send
them along to ssh to deal with. This allows users to use the full range of
ssh arguments, including specifying a command to run on the
instance. For example:

  openstack server ssh -4 upg -- -l cirros -i ~/id_rsa_upg "date; uptime"

SSH arguments that openstackclient currently mirrors are deprecated
except for -4 and -6, as they are useful for retrieving the correct
instance IP.

Change-Id: Ia50786d5eee52688e180550fe16aeb8af610154b
Co-authored-by: Stephen Finucane <stephen@that.guru>
2021-12-15 17:41:58 +00:00
Stephen Finucane
ba69870d86 compute: Fix weird option definition for 'server ssh'
argparse allows you to specify multiple options for a given argument
when declaring the argument. For some reason, we weren't doing this for
the 'server ssh' command. There's no apparent reason for doing things
this way and it's been that way since the beginning (2013) so let's not
do that.

We also add unit tests since they were missing and should exist.

Change-Id: I67a9e6516d7057266210cd4083e9ddeb1cfaa5de
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-12-15 17:41:05 +00:00
Stephen Finucane
0cde82dcd8 compute: Return information about fixed IP
The compute API provides this information to us. We might as well use
it.

Change-Id: I5608fa80745975ce49712718452cfe296c0f64d2
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-12-14 15:55:33 +00:00
Ritvik Vinodkumar
9971d7253e Switch add fixed IP to SDK
Switch the add fixed IP command from novaclient to SDK.

Change-Id: I4752ea7b4bfc17e04b8f46dbe9a68d938501a89e
2021-12-14 14:55:22 +00:00
Zuul
c10a4cd966 Merge "Allow unset port's host_id" 2021-12-13 10:26:18 +00:00
Dr. Jens Harbott
4e9b929842 Allow setting gateway when creating a router
These options are not only valid when modifying a router, but also when
one is created initially.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I3e12901f37cbd1639ac9dc9cc49b04114b80474c
2021-12-09 13:49:27 +00:00
Dr. Jens Harbott
32e18253fa Fix RemoveServerVolume
The nova API we're using to delete a server volume attachment needs to
be handed a volume, not a volume attachment.

Also make sure that we create an error if the volume isn't actually
attached to the server.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Co-authored-by: Stephen Finucane <sfinucan@redhat.com>
Change-Id: I12abd3787ea47acb4da282d00fdc1989405a0564
2021-12-08 17:59:27 +00:00
Rodolfo Alonso Hernandez
bef70397a3 Add network update quota "limit_check" parameter
This new parameter commands the Neutron server to first check the
resource usage before setting the new quota limit. If the resource
usage is below the new limit, the Neutron server will raise an
exception.

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/806254
Depends-On: https://review.opendev.org/c/openstack/neutron/+/801470

Partial-Bug: #1936408
Change-Id: Idc1b99492d609eb699d0a6bef6cd760458a774f6
2021-12-07 17:49:26 +00:00
Rodolfo Alonso Hernandez
c8c4f76498 Add --security-group to port list
The neutron API supports filtering ports by security group.

Closes-Bug: #1405057

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/804979
Change-Id: I0f626882716c21ac200c1b929ea04664d21874d8
2021-12-02 11:12:47 +00:00
Zuul
9eb42403d3 Merge "compute: Show flavor in 'server list' with API >= 2.47" 2021-11-30 19:45:10 +00:00
Zuul
d9ad0b5d46 Merge "Switch openstack server remove port/network to using sdk" 2021-11-30 19:08:01 +00:00
Zuul
e02fd2ab18 Merge "Switch server suspend and server resume to SDK" 2021-11-30 19:07:58 +00:00
Zuul
cf02135b52 Merge "Switch server pause and server unpause to SDK" 2021-11-30 19:07:55 +00:00
Zuul
3456ee7031 Merge "compute: Reorder building of columns for 'server list'" 2021-11-30 19:07:53 +00:00
Khomesh Thakre
8e362402de compute: Show flavor in 'server list' with API >= 2.47
Fix the issue where the flavor name was empty in server list output.
This requires somewhat invasive unit test changes to reflect the changed
API response from the server, but this has the upside of meaning we
don't need new tests since what we have validates things.
Also drop the flavor ID column as it is removed from the compute API.

Change-Id: Ica3320242a38901c1180b2b29109c9474366fde0
Signed-off-by: Khomesh Thakre <khomeshthakre24@gmail.com>
Story: 2008257
Task: 41113
2021-11-30 16:52:37 +00:00
Stephen Finucane
4c3de28e83 compute: Reorder building of columns for 'server list'
This has no impact on the end result, but it should make fixing issues
introduced by API microversion 2.69 a little easier.

Change-Id: I7d70eac8aa1a6197ed05a49f071e6899ec219c03
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-11-30 09:34:38 -05:00
Zuul
1cd0d084f5 Merge "image: Remove dead test helper methods" 2021-11-29 21:54:49 +00:00
Thrivikram Mudunuri
ff96fea012
Switch server suspend and server resume to SDK
Switch the server suspend and server resume commands from novaclient to
SDK. Use the SDK versions of test fakes to support fake Server
resources.

Change-Id: Idd0b4f13fab0f238e42844a7d759538bbda24f68
2021-11-29 11:50:04 -05:00
Thrivikram Mudunuri
b515fe61b2
Switch server pause and server unpause to SDK
Switch the server pause and server unpause commands from novaclient to
SDK. Use the SDK versions of test fakes to support fake Server
resources.

Change-Id: Id626f06f3d7edd44b306b7fc7b9b00d04af09621
2021-11-29 11:47:58 -05:00
Diwei Zhu
f82afc7f37 Switch openstack server remove port/network to using sdk
Change-Id: I1540c1f52e9a107dba20eeea9dc323c5510fe2b1
2021-11-29 14:31:07 +00:00
Zuul
397688320d Merge "Switch server image create to SDK" 2021-11-29 13:38:51 +00:00
Slawek Kaplonski
f462933113 Allow unset port's host_id
It is supported by Neutron and needs to be done like that when e.g.
admin wants to unbound port from the host.

Task: #44043
Story: #2009705
Change-Id: I08f1bb40f4dc72cfa7c62feeb5f513455de0ca45
2021-11-28 19:58:46 +01:00
Diwei Zhu
fae293dd52 Switch command server remove volume to sdk
Change-Id: If6f6cf93b55a67e767c54de8ce21f25252cf99ca
2021-11-26 16:11:21 +00:00
Diwei Zhu
28cd5763de Add functional test for server add/remove volume.
Change-Id: I86a76f32790cafcff1d94364fb72f8890a8cb025
2021-11-26 14:11:02 +00:00
Zuul
4b3cdaf8b1 Merge "Switch command server add volume to sdk." 2021-11-25 17:46:47 +00:00
Zuul
6fb71af243 Merge "Add --subnet-pool to subnet list" 2021-11-25 17:46:44 +00:00
Dr. Jens Harbott
860d636047 Temporarily drop aodhclient from doc build
Building plugin documentation is failing for aodhclient when running
with latest pyparsing. Drop the plugin from docs for now until the issue
can be fixed.

Needed-By: https://review.opendev.org/c/openstack/requirements/+/818614/
Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I1cc1efd9ff2004dd711ed9da0b1d9e8be31175f4
2021-11-24 06:51:17 +01:00
Diwei Zhu
3078a0a121 Switch command server add volume to sdk.
File tests.unit.volume.v2.fakes is modified to provide sdk volume fakes.
File tests.unit.compute.v2.fakes is modified to provide sdk volume
attachment fakes. For test, setup_sdk_volumes_mock() method is created
so that volumes are created in similar way as servers are created.

Change-Id: I290ba83b6ba27a1377ab73fd0ae06ecced25efd1
2021-11-22 16:01:29 +00:00
JieonLee
b3d09ffc37 Add missing command mapping in nova
nova command: instance-action
openstack command: server event show

Change-Id: I8e5dad90cfd28b1f0d65be688651918869f679e4
2021-11-21 05:05:25 +00:00
Stephen Finucane
690e9a13a2 image: Remove dead test helper methods
These haven't been used since we switched the image commands from
glanceclient to openstacksdk. There's more cleanup to be done here but
that can be done later.

Change-Id: I3de1f24323886b122b3a30660fb3de18eb7014e9
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-11-17 11:34:36 +00:00