597 Commits

Author SHA1 Message Date
Zuul
16f3e62dc4 Merge "pre-commit: Migrate pyupgrade to ruff-format" 2024-12-10 23:50:31 +00:00
Zuul
abfd5b8630 Merge "Replace netifaces library" 2024-11-27 10:28:49 +00:00
Takashi Kajinami
7df9a721ef Replace netifaces library
The natifaces library[1] was abandoned more than 3 years ago. Replace
it by psutils which is already used by a few other projects.

[1] https://github.com/al45tair/netifaces

Closes-Bug: #2071596
Change-Id: I805321229e84a57312bbe160d330281e6c13ab97
2024-11-27 02:03:58 +09:00
Stephen Finucane
399dfcc0e5 pre-commit: Migrate pyupgrade to ruff-format
openstack/tests/unit/cloud/test_stack.py needs some manual fixes but
this is otherwise auto-generated.

Change-Id: If0d202ece232181c16ee4990eb428e9ad6e91cd5
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-11-12 14:27:23 +00:00
0weng
aff5e358ac Identity: Support assigning inherited roles
Change-Id: I7ab6a693f486b5093533e123e6f9d0cefa3c1a83
2024-10-21 23:05:56 +00:00
Stephen Finucane
b753d4b849 cloud: Don't raise error on missing domain
We inverted logic in I3f543b82ec6b663e6a0dbabba323963c5b24e378. Revert
that change.

Note that we don't add any new tests. We already had a test for this.
It's simply not running right now due to the issue we're addressing
separately, in change I3fc33a26b0d7f057d7bd6a094fc2ceeaa88f177b.

Change-Id: I0d828e0871bd8b4c845694ee94fde0a167f73709
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-10-03 13:40:57 +01:00
Zuul
16781a9fb4 Merge "Deprecate unnecessary options, aliases" 2024-10-02 10:54:02 +00:00
Zuul
c6e857cf12 Merge "cloud: Stop reimplementing ignore_missing=False" 2024-10-02 10:22:57 +00:00
Stephen Finucane
7069879b58 Deprecate unnecessary options, aliases
Change-Id: Ia2203bea15c8593611f01eca6ab511c0e11ae8b6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-10-02 09:52:16 +02:00
Zuul
f1cd4f1d06 Merge "cloud: Consistently set 'ignore_missing' arguments" 2024-09-26 17:16:37 +00:00
Zuul
0aaab13251 Merge "Add timeline for removal of deprecated features" 2024-09-24 18:03:33 +00:00
Zuul
169db7a865 Merge "cloud: Deprecate passing dicts" 2024-09-24 18:03:17 +00:00
Stephen Finucane
52672a57f0 cloud: Stop reimplementing ignore_missing=False
Rather than setting this to True and then checking locally for Noneness,
just set it to False. We lose a small bit of granularity in error
message but remove quite a bit more code.

Change-Id: Ic5f8c0d0c3bc4e86cf7bbe5a159f78dd4e384aaa
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-09-25 02:52:12 +09:00
Stephen Finucane
bd6ab754e6 cloud: Consistently set 'ignore_missing' arguments
Change-Id: I3f543b82ec6b663e6a0dbabba323963c5b24e378
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-09-25 02:44:55 +09:00
Zuul
78e902920d Merge "cloud: Re-add support for passing objects" 2024-09-24 15:28:54 +00:00
Takashi Kajinami
b119c1be6d Fix internal error when floating ip network is not found by name
Ensure that the appropriate exception (NotFoundException) is raised
in case the network is not found by the specified name, to avoid ugly
TypeError raised from internal logic.

Closes-Bug: #2080859
Co-Authored-By: Alexander Stepanov <astepanov2007@gmail.com>
Change-Id: I12ee35c1fc1bd9691b230f0b5e3de9111f0d46a7
2024-09-17 01:25:33 +00:00
Stephen Finucane
6a434023f2 Add timeline for removal of deprecated features
Not all deprecated features are deprecated for removal, but those that
are need a hint for when they will start being removed. Start making use
of the new class of version-specific deprecation warnings added in
change I8bb0bfb039593c5b59f1f9c16523a090d899f099 to set timers for the
various deprecated-for-removal features we have.

Change-Id: I17d6703e82d49fca9743571f2bf1ba9c1fb3d190
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-09-12 17:17:36 +01:00
Stephen Finucane
c07e99525b cloud: Deprecate passing dicts
We want users to use strings or Resource objects instead. To do this, we
add a new warning for stuff we will remove in 6.0, and remove the now
unused warning for stuff from 4.0.

Change-Id: I7c8fb708d18c7e3b3360676dff9fb236581e5f44
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-09-12 13:09:53 +01:00
Stephen Finucane
4916542af9 cloud: Re-add support for passing objects
A follow-up patch will resolve the many TODOs we are adding here.

Change-Id: Id47a6664ed55b45e4888483d60f565ea9d1204ab
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-Bug: #2080513
2024-09-12 12:54:07 +01:00
Stephen Finucane
187e88a559 pre-commit: Migrate from black to ruff format
This is mostly a case of adding trailing commas and rewrapping things to
fit on one line.

Change-Id: Iaabb38970e8077c3cfd19041c39e3d40d2d93ffa
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-08-29 11:34:40 +01:00
Stephen Finucane
e11bb7c3c0 Deprecate 'use_direct_get' parameter
This is additional complexity that we don't want to support and won't be
able to support once everything in the cloud layer is switched over to
use the proxy layer. If users want control over this, they can use the
'get_xxx' methods in the proxy layer instead of the cloud layer.

Change-Id: I76e9e2873ad57db673516c2b66f9280f6b0280be
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-08-08 17:54:39 +01:00
Stephen Finucane
71b31f15eb cloud: Combine networking-related classes
The SecurityGroupCloudMixin, FloatingIPCloudMixin and
NetworkingCommonCloudMixin classes all exist to handle the difference
between nova-network and neutron. Combine them and use them as a
subclass for the ComputeCloudMixin and NetworkingCloudMixin classes.
This makes our class hierarchy a little messier but it's the only
obvious way I have to address this issue that doesn't involve something
like decorator gymnastics.

Change-Id: I4b101124e19636dfa9a0f704914f5100870a9fb9
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-30 13:48:12 +01:00
Stephen Finucane
aee8220952 cloud: Misc type fixes
Change-Id: I8f36ff031c2be5c66ccaaa31e9215d7bac539257
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-30 13:48:12 +01:00
Stephen Finucane
2f1829c1da cloud: Reorganize _OpenStackCloudMixin, Connection (2/2)
This is the second part, where we move stuff that is in the former but
really belongs in the latter. This is anything to do with general
session management or multiple services.

Change-Id: Ic614b0464690b780d64b796d7fa91de853850d53
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-30 13:48:11 +01:00
Stephen Finucane
d6e11e4874 cloud: Reorganize _OpenStackCloudMixin, Connection (1/2)
There's a lot of stuff in the latter that should really be in the
former, now that it's the base class of many other things. Correct this.

Change-Id: Icf2ff3ffa59e93b5cc15b2fe66668f731181c9ba
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-30 13:47:30 +01:00
Stephen Finucane
4a7e36f319 cloud: Make service mixins subclass _OpenStackCloudMixin
Another step towards normalization.

Change-Id: I8c928f80ee6420b6eab2fa2d006783098056a649
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-24 13:13:59 +01:00
Stephen Finucane
c842154091 cloud: Make _OpenStackCloudMixin subclass ServicesMixin
This is the next step in normalizing the class hierarchy in
'openstack.cloud'.

We also fix some docstrings while we're here.

Change-Id: Ic6762a131e03f78f1d290b0065f3628d3e478f8d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-24 13:13:59 +01:00
Stephen Finucane
04a1cd2fb7 cloud: Fix annotations for proxy method
These align with the definitions in ServiceMixin.

Change-Id: I6cd8970b707f062febd5d4b65749731a249df6b8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-24 13:13:59 +01:00
Stephen Finucane
edd72883de cloud: Remove check for nova extensions
All Nova extensions are enabled in API v2.1, which is the only API
version we support now. There's no reason to query for these things.

Change-Id: Ib12b2f4fe53182e047d6264de850178909b8fd5d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-24 13:13:59 +01:00
Stephen Finucane
c65b4d7c24 cloud: Replace reference to removed variable
We removed the floating network-specific caching in change
Ife5bda82eeb10c093b6cb55b0027ec16c89734d7 but an errant rebase of change
I10d3782899ac519f715d771d83303990a8289f04 reintroduced some use of the
now removed private variables used for this caching. Remove them again.

Change-Id: I5f867f91bb0e3a564d039d7184eadbe171e8f922
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2073261
2024-07-24 13:09:09 +01:00
Zuul
7febed2d42 Merge "exceptions: ResourceNotFound -> NotFoundException" 2024-07-19 16:49:54 +00:00
Zuul
f060c869be Merge "cloud: Fix typo" 2024-07-19 15:23:31 +00:00
Stephen Finucane
9145dcec64 compute, volume: Improve 'update_quota_set'
The implementations of these were rather confusing and required two
separate sets of arguments. Simplify them based on the
'delete_quota_set' methods.

Change-Id: I8bb0bfb039593c5b59f1f9c16523a090d899f099
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-11 12:59:45 +01:00
Stephen Finucane
8ccf5132ec cloud: Fix typo
Change-Id: Ifd8b3a96c86b96b258193612223026dd1179eda3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-06-27 15:32:02 +01:00
Stephen Finucane
14c1ebbeb8 exceptions: ResourceNotFound -> NotFoundException
Invert the order of these such that ResourceNotFound is an alias of
NotFoundException rather than the other way around. This is more
consistent with the other HTTP-related exceptions.

Change-Id: I3b669494cf7dc4e540a54070de42b1befe803e14
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-06-13 12:39:24 +01:00
Stephen Finucane
916f9af658 compute, block storage: Minor fixes to limits
Add a proper RateLimit class for compute (even though this is no longer
a thing starting in Newton) and use consistent naming across services.

Change-Id: Ib8a926900dca77cf48492839664bf2c5c13aab70
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-06-11 13:14:44 +01:00
Zuul
9af5594e3c Merge "Identity: Add support for inherited_to for role_assignments" 2024-05-10 18:44:57 +00:00
ArtofBugs
00ed7a5eed Identity: Add support for inherited_to for role_assignments
Change-Id: I977fba4a49d8bd779fc14851ab4145cebb66d46c
2024-05-08 09:42:08 -07:00
Stephen Finucane
8b02b04572 trivial: Prepare for pyupgrade pre-commit hook
This is kept separate from addition of the actual hook so that we can
ignore the commit later.

Change-Id: I3af752894490d619b3ef755aca5e717edafe104c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-26 17:38:54 +01:00
Zuul
1b6292c5a3 Merge "cloud: Do not reference other cloud mixin's methods" 2024-04-26 14:06:02 +00:00
Zuul
5041ea8687 Merge "cloud: Trivial fixes" 2024-04-26 13:53:55 +00:00
Zuul
05279611f9 Merge "cloud: Remove use of OpenStackCloudCreateException" 2024-04-26 13:07:40 +00:00
Zuul
12de8a105e Merge "hacking: Add check for deprecated exception types" 2024-04-26 12:36:08 +00:00
Zuul
f22f20a9f6 Merge "Allow tags to be passed through to compute.create_server" 2024-04-26 12:33:58 +00:00
Stephen Finucane
a8adbadf0c cloud: Do not reference other cloud mixin's methods
We are using a mixin-like pattern to construct the cloud layer of our
API. However, this is not a true mixin pattern since each of the
"mixins" have dependencies on each other and to be honest, it's really
only there to allow us to split up the otherwise giant 'Connection'
object. Unfortunately this pattern doesn't really work with type
checkers or language servers since there's no obvious way to identify
where the additional resources are coming from until they're combined in
the 'Connection' class. Fixing this will require multiple steps, but the
first it to remove all dependencies between the various service mixins.
As such, rather than depending on e.g. the 'get_volume' cloud method in
various compute-related cloud methods, we use the 'find_volume' proxy
method. A later change can then add these various proxy attributes,
exposing them.

Change-Id: I10d3782899ac519f715d771d83303990a8289f04
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-26 11:48:42 +01:00
Stephen Finucane
763e09a4b1 cloud: Trivial fixes
Before we combine the various nova-net/neutron common network functions
address a few nits around return statement indentation and docstring
wrapping.

Change-Id: I992673d30225c6639012fd4add91e86ac5e72966
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-26 11:48:40 +01:00
Stephen Finucane
f90fd9a307 cloud: Remove use of OpenStackCloudCreateException
We'd like to get rid of the openstack.cloud.exc module. This exception
has one user so it is an easy cull.

Change-Id: I9b6a96d3b4d66ed69d87ba2a1d27bee9bab8c98d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-26 10:45:27 +01:00
Stephen Finucane
5de45a329d hacking: Add check for deprecated exception types
We also move everything to a new module with no external imports so
flake8 can import it without needing to install all the dependencies of
openstacksdk.

Change-Id: I8e610bc196f530223b27a6fbb8e8ca11b6420b82
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-26 10:45:27 +01:00
Stephen Finucane
e67a7b14b9 pre-commit: Bump versions
We apply fold in the new black changes also.

Change-Id: I632728aa81e6c55423c0275a0a9b35e0753980a6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-23 12:16:51 +01:00
Stephen Finucane
92868d3e8b pre-commit: Bump linter versions
Fix the issues this uncovers. We also migrate to the native hacking
pre-commit hook.

Change-Id: I44385c25fcb010f3e62b4098fd34ae3290292630
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-01-09 11:57:24 +00:00