Fix nits in support traits changes
Addresses the comments from earlier patches: https://review.openstack.org/535642 https://review.openstack.org/536085 Co-Authored-By: Matt Riedemann <mriedem.os@gmail.com> Change-Id: I366b97ef3c141834f48949700edb968a7c7c4167
This commit is contained in:
parent
dbd7773e05
commit
d584b00839
|
@ -196,7 +196,7 @@ def _transform_allocation_candidates(alloc_cands, want_version):
|
||||||
|
|
||||||
include_traits = want_version.matches((1, 17))
|
include_traits = want_version.matches((1, 17))
|
||||||
p_sums = _transform_provider_summaries(alloc_cands.provider_summaries,
|
p_sums = _transform_provider_summaries(alloc_cands.provider_summaries,
|
||||||
include_traits)
|
include_traits=include_traits)
|
||||||
return {
|
return {
|
||||||
'allocation_requests': a_reqs,
|
'allocation_requests': a_reqs,
|
||||||
'provider_summaries': p_sums,
|
'provider_summaries': p_sums,
|
||||||
|
|
|
@ -306,9 +306,9 @@ def normalize_traits_qs_param(val):
|
||||||
"""
|
"""
|
||||||
ret = set(substr.strip() for substr in val.split(','))
|
ret = set(substr.strip() for substr in val.split(','))
|
||||||
if not all(trait for trait in ret):
|
if not all(trait for trait in ret):
|
||||||
msg = _('Invalid query string parameters: Expected \'required\' '
|
msg = _("Invalid query string parameters: Expected 'required' "
|
||||||
'parameter value of the form: HW_CPU_X86_VMX,CUSTOM_MAGIC. '
|
"parameter value of the form: HW_CPU_X86_VMX,CUSTOM_MAGIC. "
|
||||||
'Got: "%s"') % val
|
"Got: %s") % val
|
||||||
raise webob.exc.HTTPBadRequest(msg)
|
raise webob.exc.HTTPBadRequest(msg)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ allocation_candidates_required:
|
||||||
required: false
|
required: false
|
||||||
min_version: 1.17
|
min_version: 1.17
|
||||||
description: >
|
description: >
|
||||||
Accepts a list of traits separated by `,`. Allocation requests in the
|
Accepts a list of comma-separated traits. Allocation requests in the
|
||||||
response will be for resource providers that have capacity for all
|
response will be for resource providers that have capacity for all
|
||||||
requested resources and the set of those resource providers will
|
requested resources and the set of those resource providers will
|
||||||
*collectively* contain all of the required traits.
|
*collectively* contain all of the required traits.
|
||||||
|
@ -252,7 +252,8 @@ provider_summaries:
|
||||||
description: >
|
description: >
|
||||||
A dictionary keyed by resource provider UUID,
|
A dictionary keyed by resource provider UUID,
|
||||||
of dictionaries of inventory/capacity information. The list of traits
|
of dictionaries of inventory/capacity information. The list of traits
|
||||||
the resource provider has associated with it is included in version `1.17`.
|
the resource provider has associated with it is included in version `1.17`
|
||||||
|
and above.
|
||||||
reserved: &reserved
|
reserved: &reserved
|
||||||
type: integer
|
type: integer
|
||||||
in: body
|
in: body
|
||||||
|
|
|
@ -6,5 +6,5 @@ features:
|
||||||
separated by ``,``, which is used to further limit the list of allocation
|
separated by ``,``, which is used to further limit the list of allocation
|
||||||
requests to resource providers that have the capacity to fulfill the
|
requests to resource providers that have the capacity to fulfill the
|
||||||
requested resources AND *collectively* have all of the required traits
|
requested resources AND *collectively* have all of the required traits
|
||||||
associated with them. In the same microversion, the candidate attached
|
associated with them. In the same microversion, the provider summary
|
||||||
traits returned in the provider summary.
|
includes the traits associated with each provider.
|
||||||
|
|
Loading…
Reference in New Issue