From: Russell Bryant Date: Fri, 30 Nov 2012 14:19:05 +0000 (-0500) Subject: Ensure request_spec can be serialized. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=31629f637b6b18ca762604a24278249eeb6cfaf1;p=openstack-build%2Fcinder-build.git 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 --- 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')