summaryrefslogtreecommitdiffstats
path: root/nova/tests/scheduler/test_chance_scheduler.py
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-08-01 16:48:03 -0400
committerRussell Bryant <rbryant@redhat.com>2012-08-03 22:13:28 -0400
commit6e134c9df2ec05ebce9f62c6d85988ece18620ad (patch)
tree4aa467c5fe04990c3c51d7cfa5efd26b6f862117 /nova/tests/scheduler/test_chance_scheduler.py
parent5fb51ea04b2ccff55f45af9e99cecd5d22f27a42 (diff)
downloadnova-6e134c9df2ec05ebce9f62c6d85988ece18620ad.tar.gz
nova-6e134c9df2ec05ebce9f62c6d85988ece18620ad.tar.xz
nova-6e134c9df2ec05ebce9f62c6d85988ece18620ad.zip
Updates to the prep_resize scheduler rpc call.
I started looking at this because of the prep_resize rpc call in the compute manager. An API server calls prep_resize on the scheduler which then calls it on a compute node. I will need to make the same changes on the compute side, but this is the first step. The prep_resize call was taking two object IDs, an instance UUID and an instance_type ID. Both of these have been converted. It now takes an instance dict and an instance_type dict, instead. It can also handle receiving the old IDs for backwards compatibility. prep_resize also took a topic argument that was unused, so it has just been removed. There are a number of changes in the scheduler code tied up in this to make it more explicit about exactly what arguments are expected instead of just using *args, **kwargs. Part of blueprint no-db-messaging. Change-Id: I4af18e5575e2bb60a410fc8edabf3d607c72aabc
Diffstat (limited to 'nova/tests/scheduler/test_chance_scheduler.py')
-rw-r--r--nova/tests/scheduler/test_chance_scheduler.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/nova/tests/scheduler/test_chance_scheduler.py b/nova/tests/scheduler/test_chance_scheduler.py
index ec853594b..eabfa93dc 100644
--- a/nova/tests/scheduler/test_chance_scheduler.py
+++ b/nova/tests/scheduler/test_chance_scheduler.py
@@ -149,7 +149,8 @@ class ChanceSchedulerTestCase(test_scheduler.SchedulerTestCase):
self.mox.StubOutWithMock(driver, 'cast_to_compute_host')
self.mox.StubOutWithMock(driver, 'encode_instance')
# instance 1
- self.driver._schedule(ctxt, 'compute', request_spec).AndReturn('host')
+ self.driver._schedule(ctxt, 'compute', request_spec,
+ {}).AndReturn('host')
self.driver.create_instance_db_entry(
ctxt, mox.Func(_has_launch_index(0)), None
).WithSideEffects(_add_uuid(1)).AndReturn(instance1)
@@ -157,7 +158,8 @@ class ChanceSchedulerTestCase(test_scheduler.SchedulerTestCase):
instance_uuid=instance1['uuid'])
driver.encode_instance(instance1).AndReturn(instance1)
# instance 2
- self.driver._schedule(ctxt, 'compute', request_spec).AndReturn('host')
+ self.driver._schedule(ctxt, 'compute', request_spec,
+ {}).AndReturn('host')
self.driver.create_instance_db_entry(
ctxt, mox.Func(_has_launch_index(1)), None
).WithSideEffects(_add_uuid(2)).AndReturn(instance2)