]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Call to_primitive on volumes.rpcapi.create_volume
authorFlaper Fesp <flaper87@gmail.com>
Wed, 4 Sep 2013 11:29:22 +0000 (13:29 +0200)
committerFlavio Percoco <flaper87@gmail.com>
Tue, 10 Sep 2013 09:29:16 +0000 (11:29 +0200)
commit587eb5a6b9acc9f02eee1147dbaafb3782c295d5
tree5fc4cf384a9f25da561b57653bd8fa4aa907d4f3
parente7168b85e8a376b05f95c58b697bab166c15abe2
Call to_primitive on volumes.rpcapi.create_volume

cinder.volume.rpcapi.create_volume does not convert the request_spec to
primitive before casting the request. This makes requests containing non
primitive types to fail. For example:

cinder create --metadata=Type=test --source-volid $VOLID 1

This will create a new database record and call create_volume on
volume.rpcapi.  This will fail because VolumeMetadata won't be
serialized correctly when calling cast. This, however, is not True when
--source-volid is not passed because in such case,
scheduler.rpcpai.create_volume will be called, which converts
request_spec to primitive correctly.

Closes-Bug: #1213964
Change-Id: I096d815254c9782390fba05ea9cd9af925635402
cinder/tests/test_volume_rpcapi.py
cinder/volume/rpcapi.py