nova/nova/api/openstack/placement
Tetsuro Nakamura 7e5b0b2b37 Skip _exclude_nested_providers() if not nested
In rocky cycle, 'GET /allocation_candidates' started to be aware of
nested providers from microversion 1.29, namely, it can have multiple
allocations from multiple resource providers in the same tree in the
allocation requests.

To keep the behavior of microversion before 1.29, it added a filters
to exculde nested providers being unaware of the nested architecture.
However that function "_exclude_nested_providers()" is very heavy
and is executed even if there is no nested provider in the environment
when microversion < 1.29.

This patch changes it to skip it if there is no nested provider.

Since _exclude_nested_providers() should be done before limitting
the candidates, this patch also moves it from hander file to the
deeper layer.

This is manually backported from the placement repository:
commit 727fb88dccfe8461cc40ae53ca2d4e40fd2a9c3c

Change-Id: I4efdc65395e69a6d33fba927018d003cce26fa68
Closes-Bug: #1828937
(cherry picked from commit 3b17dd7615)
2019-05-16 01:04:31 +00:00
..
handlers Skip _exclude_nested_providers() if not nested 2019-05-16 01:04:31 +00:00
objects Skip _exclude_nested_providers() if not nested 2019-05-16 01:04:31 +00:00
policies Set scope for remaining placement policy rules 2018-05-30 09:20:24 -04:00
schemas [placement] disallow additional fields in allocations 2018-07-19 10:46:13 +01:00
__init__.py Add initial framing of placement API 2016-07-29 10:31:36 +00:00
auth.py Implement granular policy rules for placement 2018-05-17 11:12:16 -04:00
context.py Follow up changes to granular placement policy reviews 2018-05-26 12:54:54 -04:00
db_api.py Harden placement init under wsgi 2018-11-12 11:30:32 +00:00
deploy.py placement: ignore policy scope check failures if not enforcing scope 2018-08-15 00:43:38 +00:00
direct.py Adapter raise_exc=False by default 2018-06-22 09:40:33 -05:00
errors.py Resource_provider API handler does not return specific error codes 2018-07-06 15:38:44 +05:30
exception.py [placement] Retry allocation writes server side 2018-07-31 10:57:16 +01:00
fault_wrap.py [placement] use simple FaultWrapper 2018-02-28 20:34:12 +00:00
handler.py Add granular policy rules for allocation candidates 2018-05-26 12:54:51 -04:00
lib.py __str__ methods for RequestGroup, ResourceRequest 2018-05-14 14:56:12 -05:00
microversion.py Add microversion for nested allocation candidate 2018-06-29 17:38:10 +09:00
policy.py Follow up changes to granular placement policy reviews 2018-05-26 12:54:54 -04:00
requestlog.py [placement] default to accept of application/json when */* 2018-05-15 16:55:42 +01:00
resource_class_cache.py [placement] Move resource_class_cache into placement hierarchy 2018-08-03 14:55:49 +01:00
rest_api_version_history.rst [placement] Add version directives in the history doc 2018-08-07 16:55:59 +09:00
util.py Merge "Add placement.concurrent_udpate to generation pre-checks" 2018-08-01 12:19:49 +00:00
wsgi.py placement: Always reset conf.CONF when starting the wsgi app 2018-09-27 06:35:06 +00:00
wsgi_wrapper.py Provide framework for setting placement error codes 2018-04-14 13:45:54 +01:00