summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-08-28 02:26:07 +0000
committerGerrit Code Review <review@openstack.org>2012-08-28 02:26:07 +0000
commit2907ddfffcdea081ca2213d9c6989ae2534168d6 (patch)
treef3a48adb47db788ec4c96a66f60bd65b397bfff8
parent42b95f2e9476a24f3c927d61c9ea33a556b54283 (diff)
parent269bad54b6a94b01b2835707c75038d560f59cb8 (diff)
Merge "Fixes backwards compatible rpc schedule_run"
-rw-r--r--nova/scheduler/driver.py5
-rw-r--r--nova/tests/scheduler/test_scheduler.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/nova/scheduler/driver.py b/nova/scheduler/driver.py
index 7522ec6bf..42e05e903 100644
--- a/nova/scheduler/driver.py
+++ b/nova/scheduler/driver.py
@@ -34,6 +34,7 @@ from nova.openstack.common import importutils
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
@@ -173,7 +174,9 @@ class Scheduler(object):
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.
diff --git a/nova/tests/scheduler/test_scheduler.py b/nova/tests/scheduler/test_scheduler.py
index 34b4a240a..113b16b35 100644
--- a/nova/tests/scheduler/test_scheduler.py
+++ b/nova/tests/scheduler/test_scheduler.py
@@ -368,7 +368,7 @@ class SchedulerTestCase(test.TestCase):
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)