Merge "Resource limits check sometimes enforced for forced scheduling"
This commit is contained in:
commit
5fec8df325
|
@ -113,7 +113,8 @@ def populate_filter_properties(filter_properties, host_state):
|
||||||
_add_retry_host(filter_properties, host, nodename)
|
_add_retry_host(filter_properties, host, nodename)
|
||||||
|
|
||||||
# Adds oversubscription policy
|
# Adds oversubscription policy
|
||||||
filter_properties['limits'] = limits
|
if not filter_properties.get('force_hosts'):
|
||||||
|
filter_properties['limits'] = limits
|
||||||
|
|
||||||
|
|
||||||
def _add_retry_host(filter_properties, host, node):
|
def _add_retry_host(filter_properties, host, node):
|
||||||
|
|
|
@ -145,7 +145,13 @@ class SchedulerUtilsTestCase(test.NoDBTestCase):
|
||||||
scheduler_utils.populate_filter_properties(filter_properties,
|
scheduler_utils.populate_filter_properties(filter_properties,
|
||||||
host_state)
|
host_state)
|
||||||
|
|
||||||
self.assertEqual('fake-limits', filter_properties['limits'])
|
if force_hosts:
|
||||||
|
expected_limits = None
|
||||||
|
else:
|
||||||
|
expected_limits = 'fake-limits'
|
||||||
|
self.assertEqual(expected_limits,
|
||||||
|
filter_properties.get('limits'))
|
||||||
|
|
||||||
if with_retry and not force_hosts and not force_nodes:
|
if with_retry and not force_hosts and not force_nodes:
|
||||||
self.assertEqual([['fake-host', 'fake-node'],
|
self.assertEqual([['fake-host', 'fake-node'],
|
||||||
['fake-host', 'fake-node']],
|
['fake-host', 'fake-node']],
|
||||||
|
|
Loading…
Reference in New Issue