From 31629f637b6b18ca762604a24278249eeb6cfaf1 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Fri, 30 Nov 2012 09:19:05 -0500 Subject: [PATCH] Ensure request_spec can be serialized. request_spec includes some objects that must be converted to primitive types to ensure they can be serialized by any of the rpc drivers. In this case, it's the volume type. It's a sqlalchemy model. to_primitive() will ensure that it gets converted to a dict so that it can be serialized for messaging. I saw this error in a smokestack log that was running tempest with qpid. You won't see this error if you're using rabbit with the kombu driver. We have some magic with the kombu driver that will fix these problems automatically if they are missed. Change-Id: I9a1b7662bca7caa2acb61d1e3879ac2654d5b32e --- cinder/scheduler/rpcapi.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cinder/scheduler/rpcapi.py b/cinder/scheduler/rpcapi.py index 93bdb6e3e..cadde6189 100644 --- a/cinder/scheduler/rpcapi.py +++ b/cinder/scheduler/rpcapi.py @@ -19,6 +19,7 @@ Client side of the scheduler manager RPC API. """ from cinder import flags +from cinder.openstack.common import jsonutils import cinder.openstack.common.rpc.proxy @@ -46,13 +47,14 @@ class SchedulerAPI(cinder.openstack.common.rpc.proxy.RpcProxy): def create_volume(self, ctxt, topic, volume_id, snapshot_id=None, image_id=None, request_spec=None, filter_properties=None): + request_spec_p = jsonutils.to_primitive(request_spec) return self.cast(ctxt, self.make_msg( 'create_volume', topic=topic, volume_id=volume_id, snapshot_id=snapshot_id, image_id=image_id, - request_spec=request_spec, + request_spec=request_spec_p, filter_properties=filter_properties), version='1.2') -- 2.45.2