diff --git a/cinder/scheduler/rpcapi.py b/cinder/scheduler/rpcapi.py index 772a413dc..103a892ad 100644 --- a/cinder/scheduler/rpcapi.py +++ b/cinder/scheduler/rpcapi.py @@ -123,6 +123,10 @@ class SchedulerAPI(rpc.RPCAPI): if version == '2.0': # Send request_spec as dict msg_args['request_spec'] = jsonutils.to_primitive(request_spec) + # NOTE(dulek): This is to keep supporting Mitaka's scheduler which + # expects a dictionary when creating a typeless volume. + if msg_args['request_spec'].get('volume_type') is None: + msg_args['request_spec']['volume_type'] = {} cctxt = self.client.prepare(version=version) return cctxt.cast(ctxt, 'create_volume', **msg_args) diff --git a/cinder/tests/unit/scheduler/test_rpcapi.py b/cinder/tests/unit/scheduler/test_rpcapi.py index d61b2c142..3014aa36e 100644 --- a/cinder/tests/unit/scheduler/test_rpcapi.py +++ b/cinder/tests/unit/scheduler/test_rpcapi.py @@ -116,7 +116,7 @@ class SchedulerRpcAPITestCase(test.TestCase): volume_id=self.volume_id, snapshot_id='snapshot_id', image_id='image_id', - request_spec='fake_request_spec', + request_spec={'volume_type': {}}, filter_properties='filter_properties', volume=fake_volume.fake_volume_obj( self.context),