diff --git a/cinder/tests/unit/test_volume_utils.py b/cinder/tests/unit/test_volume_utils.py index 26893a23584..7feca4f01bb 100644 --- a/cinder/tests/unit/test_volume_utils.py +++ b/cinder/tests/unit/test_volume_utils.py @@ -1175,6 +1175,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 cd14176f388..b45e4ec563c 100644 --- a/cinder/volume/volume_utils.py +++ b/cinder/volume/volume_utils.py @@ -1191,6 +1191,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)