diff --git a/doc/v3/api_samples/os-scheduler-hints/scheduler-hints-post-req.json b/doc/v3/api_samples/os-scheduler-hints/scheduler-hints-post-req.json index 4f4ec9371d..0c5c998e42 100644 --- a/doc/v3/api_samples/os-scheduler-hints/scheduler-hints-post-req.json +++ b/doc/v3/api_samples/os-scheduler-hints/scheduler-hints-post-req.json @@ -4,8 +4,7 @@ "image_ref" : "http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b", "flavor_ref" : "http://openstack.example.com/openstack/flavors/1", "os-scheduler-hints:scheduler_hints": { - "hypervisor": "xen", - "near": "48e6a9f6-30af-47e0-bc04-acaed113bb4e" + "same_host": "48e6a9f6-30af-47e0-bc04-acaed113bb4e" } } -} \ No newline at end of file +} diff --git a/nova/tests/api/openstack/compute/plugins/v3/test_scheduler_hints.py b/nova/tests/api/openstack/compute/plugins/v3/test_scheduler_hints.py index 565fe38b4c..0928705300 100644 --- a/nova/tests/api/openstack/compute/plugins/v3/test_scheduler_hints.py +++ b/nova/tests/api/openstack/compute/plugins/v3/test_scheduler_hints.py @@ -75,9 +75,10 @@ class SchedulerHintsTestCase(test.TestCase): self.assertEqual(202, res.status_int) def test_create_server_with_hints(self): + hints = {'same_host': '48e6a9f6-30af-47e0-bc04-acaed113bb4e'} def fake_create(*args, **kwargs): - self.assertEqual(kwargs['scheduler_hints'], {'a': 'b'}) + self.assertEqual(hints, kwargs['scheduler_hints']) return ([self.fake_instance], '') self.stubs.Set(nova.compute.api.API, 'create', fake_create) @@ -90,7 +91,7 @@ class SchedulerHintsTestCase(test.TestCase): 'name': 'server_test', 'image_ref': 'cedef40a-ed67-4d10-800e-17455edce175', 'flavor_ref': '1', - 'os-scheduler-hints:scheduler_hints': {'a': 'b'}, + 'os-scheduler-hints:scheduler_hints': hints, }, } @@ -227,7 +228,7 @@ class ServersControllerCreateTest(test.TestCase): server = self.controller.create(req, body).obj['server'] def test_create_instance_with_scheduler_hints_disabled(self): - hints = {'a': 'b'} + hints = {'same_host': '48e6a9f6-30af-47e0-bc04-acaed113bb4e'} params = {'os-scheduler-hints:scheduler_hints': hints} old_create = compute_api.API.create @@ -241,7 +242,7 @@ class ServersControllerCreateTest(test.TestCase): override_controller=self.no_scheduler_hints_controller) def test_create_instance_with_scheduler_hints_enabled(self): - hints = {'a': 'b'} + hints = {'same_host': '48e6a9f6-30af-47e0-bc04-acaed113bb4e'} params = {'os-scheduler-hints:scheduler_hints': hints} old_create = compute_api.API.create diff --git a/nova/tests/integrated/v3/api_samples/os-scheduler-hints/scheduler-hints-post-req.json.tpl b/nova/tests/integrated/v3/api_samples/os-scheduler-hints/scheduler-hints-post-req.json.tpl index 2511889ab7..c98a0a5853 100644 --- a/nova/tests/integrated/v3/api_samples/os-scheduler-hints/scheduler-hints-post-req.json.tpl +++ b/nova/tests/integrated/v3/api_samples/os-scheduler-hints/scheduler-hints-post-req.json.tpl @@ -4,8 +4,7 @@ "image_ref" : "%(glance_host)s/openstack/images/%(image_id)s", "flavor_ref" : "%(host)s/openstack/flavors/1", "os-scheduler-hints:scheduler_hints": { - "hypervisor": "xen", - "near": "%(image_near)s" + "same_host": "%(uuid)s" } } }