Commit graph

6005 commits

Author SHA1 Message Date
Sylvain Bauza
58d1b06fdc evacuate SDK actually uses admin_pass param
Change I0cd86675a884e6c2cbd3a861b8e111f961f0f336 was incorrect,
the SDK param name is admin_pass.

Change-Id: Ibe22c3d7d7ba0f1a5178475143e35fee5cac2ca2
2024-09-18 08:46:44 +02:00
Zuul
b92291f0aa Merge "compute: Allow adding, removing multiple SGs" 2024-09-17 13:26:47 +00:00
Antonia Gaete
415f68016c identity: Migrate 'access rule' commands to SDK
Change-Id: Id5740cc61474650f22f9efe8d148c8c666c3b91e
2024-09-17 11:52:46 +01:00
Stephen Finucane
bbe04238a8 tests: Add functional test for access rules
Change-Id: I0131eab2e5395ed530c05a2e9c91b348a7a34c13
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-09-17 11:51:54 +01:00
Zuul
31251e33ec Merge "Handle NotFoundException when listing floating IPs" 2024-09-13 18:58:51 +00:00
Zuul
e46a7a2adc Merge "pre-commit: Migrate pyupgrade to ruff" 2024-09-13 17:35:54 +00:00
Zuul
eaec72e2ba Merge "pre-commit: Migrate bandit to ruff" 2024-09-13 17:35:52 +00:00
Zuul
f63784606d Merge "evacuate: Fix password parameter name for SDK" 2024-09-13 17:35:50 +00:00
Zuul
86720f8a95 Merge "tests: Remove aliasing from extensions test" 2024-09-13 12:36:49 +00:00
Zuul
108aeb0bdf Merge "Remove TestServer base class" 2024-09-13 12:36:47 +00:00
Dr. Jens Harbott
8932282952 evacuate: Fix password parameter name for SDK
The parameter is called admin_password on the SDK side.

Change-Id: I0cd86675a884e6c2cbd3a861b8e111f961f0f336
2024-09-13 13:22:26 +02:00
Nate Johnston
b0936c5b30 Handle NotFoundException when listing floating IPs
Asking for floating IPs on an undercloud results in a NotFoundException.
Make openstackclient handle it gracefully.

No test is added for this because it would need to be a scenario test -
deploying a cloud without the foalting IP extension loaded.  I don't
think this edge case is worth an entire new job just to exercise it.

Change-Id: I73b544853376d98ab0dbb14e32fefc43c1a8a179
Story: 2006863
2024-09-13 11:34:05 +01:00
Zuul
067261e80d Merge "Removed the emit_duplicated_warning() funtion." 2024-09-12 19:19:48 +00:00
Zuul
e319df4726 Merge "compute: Fix --host in server list for new openstacksdk" 2024-09-12 18:37:15 +00:00
Stephen Finucane
f98006ca9d pre-commit: Migrate pyupgrade to ruff
Change-Id: Ic50d2a5e0bc9dcdfe29f382607135cab510cd396
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-09-12 18:08:23 +01:00
Stephen Finucane
fc6852cd94 pre-commit: Migrate bandit to ruff
The name of the errors change and we need to move things around a
little, but it's otherwise a straight swap.

Change-Id: I0a19765ebeaa14c0534faa1542165b76ed2bf4e2
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-09-12 18:08:23 +01:00
Zuul
e60ca0f898 Merge "Drop support for Python 3.8" 2024-09-12 16:28:24 +00:00
Mohammed Al-Dokimi
2bf123f315 Removed the emit_duplicated_warning() funtion.
Since this function is called once, I moved its implementaion to where
its called.

Story: 2010344

Change-Id: Iaf06def1a06ffbb605ee42569e6f87b409a72772
2024-09-12 14:42:57 +01:00
Johannes Kulik
ffa683ab4e compute: Fix --host in server list for new openstacksdk
With `openstacksdk` 3.2.0 the `host` attribute of an Instance got added
to the `Server` class [0]. With that change, listing servers with the `host`
attribute leads to a query-filter for `compute_host` as expected, but
`openstacksdk` will also filter for the `host` attribute locally after
the results are returned. Since `compute_host` being
`OS-EXT-SRV-ATTR:host` is not the same as `host, this means no results
are returned.

Since we want to keep the old behaviour of filtering by `compute_host`
i.e. the service host name, we need to switch to filter for
`compute_host`. This is already supported in older versions of
`openstacksdk`.

[0] 0f311ff3e2

Change-Id: I0cd32c5b7d6d4d21194f3efdcfb9b205dea6a91e
Closes-bug: #2074200
2024-09-12 12:51:36 +00:00
Zuul
c2d96c5938 Merge "pre-commit: Migrate from black to ruff format" 2024-09-11 21:16:47 +00:00
Zuul
6e1a5ed5a6 Merge "trivial: Remove unnecessary trailing comma" 2024-09-11 21:16:45 +00:00
Zuul
9fca2b51ee Merge "pre-commit: Migrate from flake8 to ruff" 2024-09-11 21:16:44 +00:00
Zuul
21a384a868 Merge "pre-commit: Bump versions" 2024-09-11 21:16:42 +00:00
OpenStack Release Bot
b0c08ae29a Update master for stable/2024.2
Add file to the reno documentation build to show release notes for
stable/2024.2.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2024.2.

Sem-Ver: feature
Change-Id: I5b2c70118df024dfc9236c7e1fa39554ffccf5e0
2024-09-11 16:07:20 +00:00
Zuul
73e9dd1934 Merge "quota: Allow 'quota set' to function without volume service" 2024-09-06 15:46:49 +00:00
Stephen Finucane
519fa7aabc pre-commit: Migrate from black to ruff format
Change-Id: I28ca7d31d30272002799f3e2832105dc67c60538
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-08-29 15:55:39 +01:00
Stephen Finucane
17e6545fd4 trivial: Remove unnecessary trailing comma
Change-Id: I62402145c17f96626ec6e29598e32dee03a6038e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-08-29 15:55:39 +01:00
Stephen Finucane
2ba90581d5 pre-commit: Migrate from flake8 to ruff
Well, mostly. We still keep our own flake8 hooks and the hacking hooks
enabled. Everything else can be handled by ruff.

Doing this enables a couple of hacking checks that were previously
unaddressed. It also highlights a few cases that flake8 missed. Both are
addressed.

Change-Id: If81c7055e9ef692425da2789bae18a96d04b104f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-08-29 15:55:13 +01:00
Stephen Finucane
869b07eded pre-commit: Bump versions
We also drop the default language setting: everything is Python 3
nowadays.

Change-Id: I9dc9573a86c93416d1bbbc782dac76ecdda6effd
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-08-29 10:58:38 +01:00
Zuul
9c5fd76d9e Merge "compute: Add 'uuid' column to aggregate list" 2024-08-27 17:21:35 +00:00
Zuul
50d1e0916b Merge "Add callback on plugin load failure" 2024-08-14 11:12:03 +00:00
Zuul
bc6cff777f Merge "compute: Make 'hypervisor show' a bit faster" 2024-08-12 16:45:25 +00:00
Zuul
6312a6f452 Merge "compute: Only pass admin_password on rebuild if set" 2024-08-12 16:44:11 +00:00
Zuul
0d570cd66a Merge "identity: Use previous naming for 'service show' fields" 2024-08-12 16:01:30 +00:00
Zuul
e97e59d22d Merge "identity: Use previous naming for 'application credential show' fields" 2024-08-12 15:49:39 +00:00
Zuul
1aa077efee Merge "Add Python 3.12 classifier" 2024-08-09 13:10:32 +00:00
Zuul
d385bd1e03 Merge "Show Created At column for volume backups" 2024-08-09 12:20:45 +00:00
Zuul
f2cf938979 Merge "Bump requests minimal version" 2024-08-08 17:18:03 +00:00
Stephen Finucane
25780e80ab identity: Use previous naming for 'service show' fields
We changed these in change I37d07a6c5cdc98680b8d65d596521cad2b049500 but
the '-c/--column' option provided by cliff currently requires an
explicit match on column names. Change them back for now. We can revert
this when cliff is a little bit smarter.

Change-Id: I9180922e9da5c22ae3d8878946d1bf1ec4b8c6e1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2076212
2024-08-08 10:54:10 +01:00
Stephen Finucane
0e731cd22f identity: Use previous naming for 'application credential show' fields
We changed these in change Iba3fee2672d32266623c6f367beaabe84bd3d24e but
the '-c/--column' option provided by cliff currently requires an
explicit match on column names. Change them back for now. We can revert
this when cliff is a little bit cleverer.

Change-Id: I6b4f1b793dc383856bfdf9a01514381be3cd2bf1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Related-bug: #2076212
2024-08-08 10:53:25 +01:00
Stephen Finucane
4a2fd82b07 compute: Make 'hypervisor show' a bit faster
In the event that a user provides a hypervisor name rather than an ID to
the 'hypervisor show' command, passing 'details=True' (the default) to
'find_hypervisor' will ensure we get the detailed response we need.
However, this comes at the cost of retrieving reams of additional
irrelevant data for all the other hypervisors. Rather than doing this,
use a summary view and then a second call to fetch only the hypervisor
we care about.

Change-Id: I92b53802e41a962c6f916c3a111dc2de7c12d0fc
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2072965
2024-08-07 13:50:28 +01:00
Stephen Finucane
04ebe0853d compute: Add 'uuid' column to aggregate list
Change-Id: I15d4a2d5980c1ba3e00f7d1bd09f11d0f42564e1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2073542
2024-08-07 13:24:23 +01:00
Stephen Finucane
b8459c57c8 compute: Only pass admin_password on rebuild if set
In SDK change I3bc3150877c6c00aa9ec4355104308d7755aa1d4, we modified the
'rebuild_server' proxy method to use a sentinel 'unset' value so that we
could distinguish between fields that were not being changed and those
that were being changed to 'null'. However, we are currently passing the
'admin_password' field to the 'rebuild_server' SDK proxy command
regardless of whether it is set or not. Resolve this conflict.

Change-Id: If7b7585aadd43cdc6d2a9358f14223e43dc21a73
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2076232
2024-08-07 13:06:13 +01:00
Stephen Finucane
6693f555bc quota: Allow 'quota set' to function without volume service
Unlike cinderclient, SDK attempts to connect to a service as soon as you
create a client. A keystoneauth1.exceptions.catalog.EndpointNotFound
exception can be raised if this service does not exist in the service
catalog. Avoid this for the quota and limits commands by first checking
if the service is enabled.

In the process, we rework the 'is_volume_endpoint_enabled' helper we are
using to check for the existence of the service to *not* require a
volume client, since this was causing a chicken and egg issue for us
(and was also pretty much unnecessary).

Change-Id: I56e68f00ea221d689eb7f668e9e5ffa7d1a20184
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2076229
2024-08-07 11:56:07 +00:00
Zuul
a59262e44d Merge "Respect --skip-resource when deleting." 2024-08-01 13:21:54 +00:00
Joel Capitao
5238394e6a Bump requests minimal version
It's a follow-up of [1].
JSONDecodeError exception was implemented in requests
since 2.27.0 [2].

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

Change-Id: I8a6a8ac064cb0703097ed686b1fcd2983181fcfa
2024-08-01 09:38:23 +02:00
Tim Bishop
1d4aabab2e
Respect --skip-resource when deleting.
When running project cleanup and using the --skip-resource flag, this
flag is only used during the --dry-run stage. This change ensures it is
also used when deleting the resources which fixes the bug mentioned below.

Closes-Bug: #2074109
Change-Id: I8e50fd14dcde069b932cc8ec4bb4fc809f7d2eb7
2024-07-25 20:20:56 +01:00
Stephen Finucane
aa88db9448 Add callback on plugin load failure
I have seen a few cases where import errors (distutils - I am looking at you)
result in an extension not being available, but there is no indication why this
is the case. We do configure logging, but this happens too late (as part
of the 'cliff.app.App.run' call to execute a command, which calls
osc-lib's 'configure_logging' but which happens long after we've tried
to import our plugins) to be of any use. Instead, make use of a callback
to make it more obvious.

Change-Id: Id68b06161e445b79fe43f463e06cda3c4771ef02
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-24 17:00:07 +01:00
Zuul
37a22cf84c Merge "Add tests for 'default security group rule create'" 2024-07-23 15:25:51 +00:00
Zuul
965c61c90c Merge "Add volume snapshot unmanage support" 2024-07-23 12:58:03 +00:00