Merge "Enable nested allocation candidates in scheduler"

This commit is contained in:
Zuul 2018-10-04 23:33:27 +00:00 committed by Gerrit Code Review
commit c217d4dc95
2 changed files with 7 additions and 8 deletions

View File

@ -50,7 +50,7 @@ WARN_EVERY = 10
PLACEMENT_CLIENT_SEMAPHORE = 'placement_client'
RESHAPER_VERSION = '1.30'
CONSUMER_GENERATION_VERSION = '1.28'
GRANULAR_AC_VERSION = '1.25'
NESTED_AC_VERSION = '1.29'
ALLOW_RESERVED_EQUAL_TOTAL_INVENTORY_VERSION = '1.26'
POST_RPS_RETURNS_PAYLOAD_API_VERSION = '1.20'
AGGREGATE_GENERATION_VERSION = '1.19'
@ -350,10 +350,9 @@ class SchedulerReportClient(object):
"Candidates are in either 'foo' or 'bar', but definitely in 'baz'"
"""
# NOTE(gibi): claim_resources will use the this version as well so to
# support consumer generations we need to do the allocation candidate
# query with high enough version as well.
version = CONSUMER_GENERATION_VERSION
# Note that claim_resources() will use this version as well to
# make allocations by `PUT /allocations/{consumer_uuid}`
version = NESTED_AC_VERSION
qparams = resources.to_querystring()
url = "/allocation_candidates?%s" % qparams
resp = self.get(url, version=version,

View File

@ -1895,7 +1895,7 @@ class TestProviderOperations(SchedulerReportClientTestCase):
expected_url = '/allocation_candidates?%s' % parse.urlencode(
expected_query)
self.ks_adap_mock.get.assert_called_once_with(
expected_url, microversion='1.28',
expected_url, microversion='1.29',
headers={'X-Openstack-Request-Id': self.context.global_id})
self.assertEqual(mock.sentinel.alloc_reqs, alloc_reqs)
self.assertEqual(mock.sentinel.p_sums, p_sums)
@ -1935,7 +1935,7 @@ class TestProviderOperations(SchedulerReportClientTestCase):
expected_query)
self.assertEqual(mock.sentinel.alloc_reqs, alloc_reqs)
self.ks_adap_mock.get.assert_called_once_with(
expected_url, microversion='1.28',
expected_url, microversion='1.29',
headers={'X-Openstack-Request-Id': self.context.global_id})
self.assertEqual(mock.sentinel.p_sums, p_sums)
@ -1957,7 +1957,7 @@ class TestProviderOperations(SchedulerReportClientTestCase):
res = self.client.get_allocation_candidates(self.context, resources)
self.ks_adap_mock.get.assert_called_once_with(
mock.ANY, microversion='1.28',
mock.ANY, microversion='1.29',
headers={'X-Openstack-Request-Id': self.context.global_id})
url = self.ks_adap_mock.get.call_args[0][0]
split_url = parse.urlsplit(url)