diff --git a/cinder/tests/test_solidfire.py b/cinder/tests/test_solidfire.py index 189e04b03f0..ec5126310ea 100644 --- a/cinder/tests/test_solidfire.py +++ b/cinder/tests/test_solidfire.py @@ -481,6 +481,21 @@ class SolidFireVolumeTestCase(test.TestCase): 'maxIOPS': 200, 'burstIOPS': 300}) + def test_accept_transfer(self): + sfv = SolidFireDriver(configuration=self.configuration) + self.stubs.Set(SolidFireDriver, '_issue_api_request', + self.fake_issue_api_request) + testvol = {'project_id': 'testprjid', + 'name': 'test_volume', + 'size': 1, + 'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66', + 'created_at': timeutils.utcnow()} + expected = {'provider_auth': 'CHAP cinder-new_project 123456789012'} + self.assertEqual(sfv.accept_transfer(self.ctxt, + testvol, + 'new_user', 'new_project'), + expected) + def test_retype(self): sfv = SolidFireDriver(configuration=self.configuration) self.stubs.Set(SolidFireDriver, '_issue_api_request', @@ -500,7 +515,6 @@ class SolidFireVolumeTestCase(test.TestCase): 'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66', 'created_at': timeutils.utcnow()} - sfv = SolidFireDriver(configuration=self.configuration) self.assertTrue(sfv.retype(self.ctxt, testvol, type_ref, diff, host)) @@ -520,8 +534,6 @@ class SolidFireVolumeTestCase(test.TestCase): 'maxIOPS': '2000', 'burstIOPS': '3000'}} - qos_specs - def _fake_get_volume_type(ctxt, type_id): return test_type diff --git a/cinder/volume/drivers/solidfire.py b/cinder/volume/drivers/solidfire.py index 64c16e29ec6..ed21ddf882f 100644 --- a/cinder/volume/drivers/solidfire.py +++ b/cinder/volume/drivers/solidfire.py @@ -770,8 +770,8 @@ class SolidFireDriver(SanISCSIDriver): if 'result' not in data: raise exception.SolidFireAPIDataException(data=data) - volume['project_id': new_project] - volume['user_id': new_user] + volume['project_id'] = new_project + volume['user_id'] = new_user model_update = self._do_export(volume) LOG.debug("Leaving SolidFire transfer volume") return model_update