diff --git a/cinder/tests/unit/test_volume_utils.py b/cinder/tests/unit/test_volume_utils.py index 6a122fa620b..1a7d76b3426 100644 --- a/cinder/tests/unit/test_volume_utils.py +++ b/cinder/tests/unit/test_volume_utils.py @@ -1188,6 +1188,7 @@ class VolumeUtilsTestCase(test.TestCase): volume, mock.sentinel.context) self.assertEqual('aes-xts-plain64', ret['cipher']) + self.assertEqual('luks', ret['provider']) def test_check_encryption_provider_invalid(self): encryption_metadata = {'cipher': 'aes-xts-plain64', diff --git a/cinder/volume/volume_utils.py b/cinder/volume/volume_utils.py index bdebd444b43..2c806db4c73 100644 --- a/cinder/volume/volume_utils.py +++ b/cinder/volume/volume_utils.py @@ -1202,6 +1202,7 @@ def check_encryption_provider(db, volume, context): provider = encryption['provider'] if provider in encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP: provider = encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP[provider] + encryption['provider'] = provider if provider != encryptors.LUKS: message = _("Provider %s not supported.") % provider raise exception.VolumeDriverException(message=message)