summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-01-26 07:16:32 +0000
committerGerrit Code Review <review@openstack.org>2012-01-26 07:16:32 +0000
commit32a6f499b8a5d5fc3e2d7ff29d0c8e8fbf9e1a23 (patch)
treea00f63da35f731815ccb31b469564feed553e754
parent547c771ccf124caa4534816811cc37fb9e17a2a6 (diff)
parent53735e2c06c85f2fb16f5aed58f44cf685d5ea25 (diff)
downloadnova-32a6f499b8a5d5fc3e2d7ff29d0c8e8fbf9e1a23.tar.gz
Merge "Don't pass filter_properites to managers" into milestone-proposed
-rw-r--r--nova/scheduler/distributed_scheduler.py8
-rw-r--r--nova/tests/scheduler/test_distributed_scheduler.py5
2 files changed, 12 insertions, 1 deletions
diff --git a/nova/scheduler/distributed_scheduler.py b/nova/scheduler/distributed_scheduler.py
index 2e54461b82..16e688e6fb 100644
--- a/nova/scheduler/distributed_scheduler.py
+++ b/nova/scheduler/distributed_scheduler.py
@@ -98,6 +98,10 @@ class DistributedScheduler(driver.Scheduler):
if not weighted_hosts:
raise exception.NoValidHost(reason=_(""))
+ # NOTE(comstud): Make sure we do not pass this through. It
+ # contains an instance of RpcContext that cannot be serialized.
+ kwargs.pop('filter_properties', None)
+
instances = []
for num in xrange(num_instances):
if not weighted_hosts:
@@ -141,6 +145,10 @@ class DistributedScheduler(driver.Scheduler):
raise exception.NoValidHost(reason=_(""))
host = hosts.pop(0)
+ # NOTE(comstud): Make sure we do not pass this through. It
+ # contains an instance of RpcContext that cannot be serialized.
+ kwargs.pop('filter_properties', None)
+
# Forward off to the host
driver.cast_to_compute_host(context, host.host_state.host,
'prep_resize', **kwargs)
diff --git a/nova/tests/scheduler/test_distributed_scheduler.py b/nova/tests/scheduler/test_distributed_scheduler.py
index 426da044ff..f385ef7b73 100644
--- a/nova/tests/scheduler/test_distributed_scheduler.py
+++ b/nova/tests/scheduler/test_distributed_scheduler.py
@@ -129,6 +129,8 @@ class DistributedSchedulerTestCase(test.TestCase):
return least_cost.WeightedHost(1, zone='x', blob='y')
def _fake_provision_resource_locally(*args, **kwargs):
+ # Tests that filter_properties is stripped
+ self.assertNotIn('filter_properties', kwargs)
self.locally_called = True
return 1
@@ -152,7 +154,8 @@ class DistributedSchedulerTestCase(test.TestCase):
}
fake_context = context.RequestContext('user', 'project')
- instances = sched.schedule_run_instance(fake_context, request_spec)
+ instances = sched.schedule_run_instance(fake_context, request_spec,
+ filter_properties={})
self.assertTrue(instances)
self.assertFalse(self.schedule_called)
self.assertTrue(self.from_blob_called)