From f6584a6f22be3f7a0c089901d417293046905989 Mon Sep 17 00:00:00 2001 From: Tiago Mello Date: Tue, 18 Jun 2013 17:58:39 -0300 Subject: Converts scheduler.utils.build_request_spec return to json primitive Other than 'instance', 'image' can also be a complex structure and then it needs to be converted. See: nova.compute.rpcapi.prep_resize as an example. Change-Id: I54570dad3eae6ecc91a433af68263794c22e268d --- nova/scheduler/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/scheduler/utils.py b/nova/scheduler/utils.py index d17ab89b2..028c72ff7 100644 --- a/nova/scheduler/utils.py +++ b/nova/scheduler/utils.py @@ -24,10 +24,10 @@ def build_request_spec(image, instances): The request_spec assumes that all instances to be scheduled are the same type. """ - instance = jsonutils.to_primitive(instances[0]) + instance = instances[0] request_spec = { 'image': image, 'instance_properties': instance, 'instance_type': flavors.extract_flavor(instance), 'instance_uuids': [inst['uuid'] for inst in instances]} - return request_spec + return jsonutils.to_primitive(request_spec) -- cgit