summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandy Walsh <sandy.walsh@rackspace.com>2011-05-24 18:09:25 -0700
committerSandy Walsh <sandy.walsh@rackspace.com>2011-05-24 18:09:25 -0700
commita33970f17abb0fed47cd03d48a25709d987b5c25 (patch)
tree5f021e5175ed8b0481ab214c91b250d25e046233
parent48a3ec6e55f029578d5dc8ef7fe2e9fbe0de1b81 (diff)
downloadnova-a33970f17abb0fed47cd03d48a25709d987b5c25.tar.gz
nova-a33970f17abb0fed47cd03d48a25709d987b5c25.tar.xz
nova-a33970f17abb0fed47cd03d48a25709d987b5c25.zip
tests working again
-rw-r--r--nova/scheduler/zone_aware_scheduler.py2
-rw-r--r--nova/tests/api/openstack/test_zones.py4
-rw-r--r--nova/tests/test_zone_aware_scheduler.py3
3 files changed, 7 insertions, 2 deletions
diff --git a/nova/scheduler/zone_aware_scheduler.py b/nova/scheduler/zone_aware_scheduler.py
index 3dd43443a..00f5660f3 100644
--- a/nova/scheduler/zone_aware_scheduler.py
+++ b/nova/scheduler/zone_aware_scheduler.py
@@ -57,7 +57,7 @@ class ZoneAwareScheduler(driver.Scheduler):
# TODO(sandy): We'll have to look for richer specs at some point.
- blob = request_spec['blob']
+ blob = request_spec.get('blob')
if blob:
self.provision_resource(context, request_spec, instance_id,
request_spec, kwargs)
diff --git a/nova/tests/api/openstack/test_zones.py b/nova/tests/api/openstack/test_zones.py
index b42b3e7d8..e21b5ce86 100644
--- a/nova/tests/api/openstack/test_zones.py
+++ b/nova/tests/api/openstack/test_zones.py
@@ -209,6 +209,10 @@ class ZonesTest(test.TestCase):
self.stubs.Set(api, 'select', zone_select)
req = webob.Request.blank('/v1.0/zones/select')
+ req.method = 'POST'
+ # Select queries end up being JSON encoded twice.
+ # Once to a string and again as an HTTP POST Body
+ req.body = json.dumps(json.dumps({}))
res = req.get_response(fakes.wsgi_app())
res_dict = json.loads(res.body)
diff --git a/nova/tests/test_zone_aware_scheduler.py b/nova/tests/test_zone_aware_scheduler.py
index 37169fb97..493eb294f 100644
--- a/nova/tests/test_zone_aware_scheduler.py
+++ b/nova/tests/test_zone_aware_scheduler.py
@@ -118,4 +118,5 @@ class ZoneAwareSchedulerTestCase(test.TestCase):
fake_context = {}
self.assertRaises(driver.NoValidHost, sched.schedule_run_instance,
fake_context, 1,
- dict(host_filter=None, instance_type={}))
+ dict(host_filter=None,
+ request_spec={'instance_type': {}}))