From d40c75fa16e3a302a90c9edd29be6707012b21bd Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Fri, 17 Aug 2012 14:50:42 -0400 Subject: Fix a TypeError that occurs in _reschedule. Updates the compute manager so that it passes the correct arguments to the scheduler API's run_instance function. Fixes the following exception which will occur if an instance is rescheduled: TypeError: run_instance() got an unexpected keyword argument 'reservations' As part the fix the FakeSchedulerAPI we use in test_compute.py has been updated to match the arguments of the real scheduler API. Fixes LP Bug #1038193. Change-Id: I25782b79a7b19013b25cb94cc5569b5aa83a2df0 --- nova/compute/manager.py | 3 +-- nova/tests/compute/test_compute.py | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'nova') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index c0f37d877..cb455c1c9 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -600,8 +600,7 @@ class ComputeManager(manager.SchedulerDependentManager): retry['num_attempts'], instance_uuid=instance_uuid) self.scheduler_rpcapi.run_instance(context, request_spec, admin_password, injected_files, - requested_networks, is_first_time, filter_properties, - reservations=None, call=False) + requested_networks, is_first_time, filter_properties) return True @manager.periodic_task diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index 8a46d51ec..b6ce0afe2 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -75,7 +75,10 @@ def nop_report_driver_status(self): class FakeSchedulerAPI(object): - def run_instance(self, *args, **kwargs): + + def run_instance(self, ctxt, request_spec, admin_password, + injected_files, requested_networks, is_first_time, + filter_properties): pass -- cgit