Skip to content

Commit

Permalink
Fixes backwards compatible rpc schedule_run
Browse files Browse the repository at this point in the history
Commit 8718f8e changed the
schedule_run_instance call to create all of the db records on the
compute host, but the old code path was left in for backwards
compatibility. Unfortunately an extra reservations parameter was
left in causing the backwards compatibility to be broken.

This patch takes out the reservations parameter and commits the
reservation in the backwards compatible call.

Fixes bug 1042302

Change-Id: I1e710d1e9a992f59a18eeedcd7d71726ff96c485
  • Loading branch information
vishvananda committed Aug 27, 2012
1 parent c2f56b1 commit 269bad5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion nova/scheduler/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from nova.openstack.common import log as logging
from nova.openstack.common import rpc
from nova.openstack.common import timeutils
from nova import quota
from nova import utils


Expand Down Expand Up @@ -173,7 +174,9 @@ def create_instance_db_entry(self, context, request_spec, reservations):

instance = self.compute_api.create_db_entry_for_new_instance(
context, instance_type, image, base_options,
security_group, block_device_mapping, reservations)
security_group, block_device_mapping)
if reservations:
quota.QUOTAS.commit(context, reservations)
# NOTE(comstud): This needs to be set for the generic exception
# checking in scheduler manager, so that it'll set this instance
# to ERROR properly.
Expand Down
2 changes: 1 addition & 1 deletion nova/tests/scheduler/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def test_create_instance_db_entry(self):
self.driver.compute_api.create_db_entry_for_new_instance(
self.context, instance_type, image, base_options,
security_group,
block_device_mapping, None).AndReturn(fake_instance)
block_device_mapping).AndReturn(fake_instance)
self.mox.ReplayAll()
instance = self.driver.create_instance_db_entry(self.context,
request_spec, None)
Expand Down

0 comments on commit 269bad5

Please sign in to comment.