summaryrefslogtreecommitdiffstats
path: root/nova/tests/scheduler/test_chance_scheduler.py
diff options
context:
space:
mode:
authorBrian Elliott <brian.elliott@rackspace.com>2012-10-08 18:35:14 +0000
committerBrian Elliott <brian.elliott@rackspace.com>2012-10-08 20:16:34 +0000
commit5fd7a9dba127bae812333196a5fa48a933212aeb (patch)
tree7018c19caeb106bb30f9fb8f9da2b7224ae7be8b /nova/tests/scheduler/test_chance_scheduler.py
parent9d4ecc2c553b85f2fccf444498df15b09b6fe54b (diff)
downloadnova-5fd7a9dba127bae812333196a5fa48a933212aeb.tar.gz
nova-5fd7a9dba127bae812333196a5fa48a933212aeb.tar.xz
nova-5fd7a9dba127bae812333196a5fa48a933212aeb.zip
Set instance host field after resource claim
Set the 'host' field on the instance after the resource tracker on the compute node has accepted the build. The field is set after resources are confirmed to be available while the COMPUTE_RESOURCES_SEMAPHORE is held. The semaphore ensures the resources usage values will be consistent even if the update_available_resource periodic task audit runs. bug 1060255 Change-Id: I92105ec14924960ac8ef7ca8c810783085314e10
Diffstat (limited to 'nova/tests/scheduler/test_chance_scheduler.py')
-rw-r--r--nova/tests/scheduler/test_chance_scheduler.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/tests/scheduler/test_chance_scheduler.py b/nova/tests/scheduler/test_chance_scheduler.py
index 4fb9ab617..26cde055b 100644
--- a/nova/tests/scheduler/test_chance_scheduler.py
+++ b/nova/tests/scheduler/test_chance_scheduler.py
@@ -90,8 +90,8 @@ class ChanceSchedulerTestCase(test_scheduler.SchedulerTestCase):
self.driver.hosts_up(ctxt_elevated, 'compute').AndReturn(
['host1', 'host2', 'host3', 'host4'])
random.random().AndReturn(.5)
- driver.instance_update_db(ctxt, instance1['uuid'],
- 'host3').WithSideEffects(inc_launch_index).AndReturn(instance1)
+ driver.instance_update_db(ctxt, instance1['uuid']).WithSideEffects(
+ inc_launch_index).AndReturn(instance1)
compute_rpcapi.ComputeAPI.run_instance(ctxt, host='host3',
instance=instance1, requested_networks=None,
injected_files=None, admin_password=None, is_first_time=None,
@@ -102,8 +102,8 @@ class ChanceSchedulerTestCase(test_scheduler.SchedulerTestCase):
self.driver.hosts_up(ctxt_elevated, 'compute').AndReturn(
['host1', 'host2', 'host3', 'host4'])
random.random().AndReturn(.2)
- driver.instance_update_db(ctxt, instance2['uuid'],
- 'host1').WithSideEffects(inc_launch_index).AndReturn(instance2)
+ driver.instance_update_db(ctxt, instance2['uuid']).WithSideEffects(
+ inc_launch_index).AndReturn(instance2)
compute_rpcapi.ComputeAPI.run_instance(ctxt, host='host1',
instance=instance2, requested_networks=None,
injected_files=None, admin_password=None, is_first_time=None,