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
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>
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>
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>
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
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>
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>
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
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>
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>
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>
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>
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>
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>
These align with the definitions in ServiceMixin.
Change-Id: I6cd8970b707f062febd5d4b65749731a249df6b8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
We apply fold in the new black changes also.
Change-Id: I632728aa81e6c55423c0275a0a9b35e0753980a6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
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>