The user_id and project_id fields can be null. Explain why.
Change-Id: I34353ec7e55845a83f5e2f1dc4b41dead4ac5c81
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
These have been introduced at some point and now appear when running the
API samples test with GENERATE_SAMPLES=True. Add them.
Change-Id: Ic4b6b685f17e8d411776e20f239daa0736ae9a0b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Well, in a manner of speaking :) We add a new decorator to highlight the
resources that we have fully annotated. This will prevent regressions
and give us a quick sentinel for identifying resources that have been
updated.
Change-Id: Ic2cf231a01b0f053faf40409ae047c8bf9990fd2
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Remove the use of a custom format for keypair names, in favour of a
simple regex. Also remove the unused 'none' variable and generally fix
some formatting.
Change-Id: I66d0bf873dc26c8bcc4c3cdbc85575e4ebd9a1be
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Per the JSON Schema spec, format checks only apply to strings. For
example, if we have a schema like so:
{type: [string, null], format: date-time}
Then we expect either a date-time string or null, not a date-time string
or (impossible) date-time null. Make this so, cleaning up and extending
the tests in the process.
Change-Id: I755e69f78aed0cd4074204a0559f557998a34e29
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Get rid of the whole API version switching madness and make our schema
generation _significantly_ simpler.
This looks a lot larger than it actually is. In most cases, this is
simply 's/wsgi.Controller.api_version/wsgi.api_version/'.
Change-Id: I180bfad84c38653709c216282099d9b3fb64c5a7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
As noted in [1], we were passing arguments to the 'is_supported'
function inconsistently. Given we only have four easily converted users
of the 'max_version' argument, we can simplify the calls by only passing
a *minimum* API version and negating there where necessary. This is good
enough for our use cases.
[1] https://review.opendev.org/c/openstack/nova/+/936366/
Change-Id: I71a95b8b4b6b59485273f136f255811b6d57b657
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This obscures the purpose of the APIs and makes the code harder to read.
It also does not play nice with our schema checks by creating multiple
potential functions to check. We're already being pretty inconsistent in
how we do versioning like this so simply standardise on another
approach, namely checking in the function.
Note that there are docs that need updating here, but we're leaving that
to a separate PR that will also remove this method in favour of a new,
much simpler method.
Change-Id: Ia5e4c6cadb6c88ccdf7e89566573f1f89087fbe5
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Since we will soon no longer be able to rely on
wsgi.Controller.api_version to version our methods for us, we need to do
versioning in the various schema decorators slightly differently.
Change-Id: I1808ebc7c42828bafb7d079b59bbbd0bc4424f22
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
The legacy server group member counting logic fits well to use the
existing scatter-gather logic instead of rolling its own thread
handling.
This replaces a direct eventlet dependency with an indirect, shared one,
in the scatter-gather therefore making the eventlet removal work easier
Change-Id: I6d1b5f9654df2a93bd3722a5813d5ad3a7d1c94a
We have 4 ways to enter nova code and got monkey patched:
* nova.cmd - used by all of our CLI commands and non WSGI services
* nova.api.openstack - used by our WSGI services
* nova.test - used by our unit test environment to run nova services in GreenThreads.
* nova.tests.functional - used by our functional test environment to run nova services in GreenThreads.
The latter is unnecessary as all our functional test uses the nova.test
module so it automatically got monkey patches by that. So this patch
removing the monkey patching from nova.tests.functional. I don't see any
test runtime increase locally after the change so I don't think the
tests start to run more serially due to some missed monkey patch.
Change-Id: I4731dab89e2c1f1707d322c575ab0780bff80535
This change separates the evetlet monkey patching
from importing the module and add a module level
constant to track if we have already monkey patched.
Change-Id: Ic4ab0ba7a8320a008d6e246641446446dcc9ccc0
The nova debuger functionality was intended
to help debugging running process however it has
never been reliable due to our use of eventlet and is generally
not required when not using eventlet. I.e. you can just
run the nova console-scripts form a debugger or add pdb
statements as required.
As part of the eventlet removal the debugger functionality is
removed given its untested and undocumented.
Change-Id: I7bf88f06f3d1dbd2c7e342b27a21440a123c631d
As part of the Eventlet removal, this patch replaces eventlet.sleep
with the equivalent time.sleep, which should work the same
with Python threads
Change-Id: I31b1aa854d8c95e47ba476051a650937b739a52b
As [1] removed the possibility to use the Eventlet based API servers
this patch can clean up the configuration options from the [wsgi]
section that are only used by that code path.
The remaining two options [wsgi]api_paste_config and
[wsgi]secure_proxy_ssl_header are still in use by the WSGI application
code path.
[1]I79b725f3b3569e9c1460a93ac40ca92269e7d003
Change-Id: Ia113daabab399e8db8edb1a2402ccae6fca351d5
We learned during recent installer development that triggering
GMR with apache/mod_wsgi API services via signals is hard due
to multiple reasons. We ended up using file based triggers instead of
signals. This patch document this approach.
Change-Id: I1fdbe6314ce4a1b173d01d3ebd9db07a0beb25a2
The previous patch[1] removed the entry points. As there is sizable
amount of doc change needed to remove all the references from the doc
to the removed entry points a separate patch, this, is created to do so.
[1] Ie758550c0b8fb02aeb398396961467d9f845fcc9
Change-Id: Ibe8e45e86912e747f07e5fabd5b1204341c1e606
The previous patch[1] removed the Eventlet based WSGI entry points, and
that code was the only real user of the in tree WSGIService and
WSGIServer classes, we can remove those too. This removes a good chunk
of eventlet dependency from our tree.
There is a catch though. The functional test env used these to start the
nova-metadata-api service. We re-implemented the fixture to use
load the wsgi app and use the wsgi intercept instead. This also showed
that while the Eventlet based API service could be reset via the
oslo.service interface the wsgi APP based API service cannot. So the
related cell caches reset testing is removed.
[1] Ie758550c0b8fb02aeb398396961467d9f845fcc9
Change-Id: I79b725f3b3569e9c1460a93ac40ca92269e7d003
Nova deprecated[1] running the API services under Eventlet in the Rocky
release 6 years ago. Now that we are trying to transition away from
Eventlet it is time to rip out these entry points fully.
[1] b53d81b03c
Change-Id: Ie758550c0b8fb02aeb398396961467d9f845fcc9
This change removes the concept of plug time vs
bind time live migrations events.
In past releases Id2d8d72d30075200d2b07b847c4e5568599b0d3b
and I51673e58fc8d5f051df911630f6d7a928d123a5b
added workarounds to nova to enable live migration with
the ovn backend. Over the past 5 years a lot of work has
been done in ovn and neutron to support multiple port
bindings and propagage that information to the ovn
db. As a result the workaround in nova are nolonger
required.
Related-Bug: #2073254
Change-Id: Ic3e9c93681d11d5ab988d6990e9b8d480da887d4
The request_specs_dict in the _list_view is initialized as a
defaultdict object in order to return empty string as default.
But the request_spec_dict is replaced with a normal dict object in
the v2.96 microversion, then if server list and RequestSpec missmatch
happens by any reason, the List Server API and the List
Server Detail API hit 500 Internal server error because of key error.
This commit updates the req_spec_dict to use normal dict object, then
it returns sentinel object if there is no appropriate
request_spec object.
Closes-Bug: #2095364
Change-Id: If282b8709954f276cb5d48114437809d771a9958