encryptors: Delay removal of legacy provider names

Initially Ic155bd29d46059832cce970bf60375e7e472eca6 had aimed to remove these
legacy provider names during the Pike cycle. While removing references
to these names in Tempest via Id221414d74af8413084c7935b762f93b7ce43c42 it was
highlighted that this wouldn't be possible until Queens and the eventual EOL of
Newton.

This change simply updates the logged deprecation warnings and adds a
new releasenote highlighting that these legancy provider names will
remain until Queens.

Change-Id: Ib8ca7ecb5494cd4fcae0657525d4c17bfc4ae37e
This commit is contained in:
Lee Yarwood 2017-05-08 14:12:47 -04:00
parent 67e1a39a7e
commit 0ff2c0086c
3 changed files with 15 additions and 7 deletions

View File

@ -62,13 +62,13 @@ def get_volume_encryptor(root_helper,
if location and location.lower() == 'front-end': # case insensitive
provider = kwargs.get('provider')
# TODO(lyarwood): Remove the following in Pike and raise an
# TODO(lyarwood): Remove the following in Queens and raise an
# ERROR if provider is not a key in SUPPORTED_ENCRYPTION_PROVIDERS.
# Until then continue to allow both the class name and path to be used.
if provider in LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP:
LOG.warning("Use of the in tree encryptor class %(provider)s"
" by directly referencing the implementation class"
" will be blocked in the Pike release of"
" will be blocked in the Queens release of"
" os-brick.", {'provider': provider})
provider = LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP[provider]
@ -78,7 +78,7 @@ def get_volume_encryptor(root_helper,
provider = "os_brick.encryptors.nop.NoOpEncryptor"
else:
LOG.warning("Use of the out of tree encryptor class "
"%(provider)s will be blocked with the Pike "
"%(provider)s will be blocked with the Queens "
"release of os-brick.", {'provider': provider})
try:

View File

@ -132,7 +132,7 @@ class BaseEncryptorTestCase(VolumeEncryptorTestCase):
log.warning.assert_called_once_with("Use of the out of tree "
"encryptor class %(provider)s "
"will be blocked with the "
"Pike release of os-brick.",
"Queens release of os-brick.",
{'provider': provider})
@mock.patch('os_brick.encryptors.LOG')
@ -164,15 +164,15 @@ class BaseEncryptorTestCase(VolumeEncryptorTestCase):
log.warning.assert_has_calls([
mock.call("Use of the in tree encryptor class %(provider)s by "
"directly referencing the implementation class will be "
"blocked in the Pike release of os-brick.",
"blocked in the Queens release of os-brick.",
{'provider': 'LuksEncryptor'}),
mock.call("Use of the in tree encryptor class %(provider)s by "
"directly referencing the implementation class will be "
"blocked in the Pike release of os-brick.",
"blocked in the Queens release of os-brick.",
{'provider':
'os_brick.encryptors.luks.LuksEncryptor'}),
mock.call("Use of the in tree encryptor class %(provider)s by "
"directly referencing the implementation class will be "
"blocked in the Pike release of os-brick.",
"blocked in the Queens release of os-brick.",
{'provider':
'nova.volume.encryptors.luks.LuksEncryptor'})])

View File

@ -0,0 +1,8 @@
---
deprecations:
- |
The direct use of the encryption provider classes such as
os_brick.encryptors.luks.LuksEncryptor continues to be deprecated and will
now be blocked in the Queens release of os-brick. The use of out of tree
encryption provider classes also continues to be deprecated and will also
be blocked in the Queens release of os-brick.