Only log insecure key manager warning once
We currently log a warning message every time the key manager is instantiated. This changes that to log a warning only one time. Change-Id: Ia24808396eb0e2d43c6dc6631384a254b2ee2472
This commit is contained in:
@@ -63,9 +63,14 @@ class ConfKeyManager(key_manager.KeyManager):
|
|||||||
for each method are handled as specified by the key manager interface.
|
for each method are handled as specified by the key manager interface.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
warning_logged = False
|
||||||
|
|
||||||
def __init__(self, configuration):
|
def __init__(self, configuration):
|
||||||
LOG.warning(_LW('This key manager is insecure and is not recommended '
|
if not ConfKeyManager.warning_logged:
|
||||||
'for production deployments'))
|
LOG.warning(_LW('This key manager is insecure and is not '
|
||||||
|
'recommended for production deployments'))
|
||||||
|
ConfKeyManager.warning_logged = True
|
||||||
|
|
||||||
super(ConfKeyManager, self).__init__(configuration)
|
super(ConfKeyManager, self).__init__(configuration)
|
||||||
|
|
||||||
self.conf = configuration
|
self.conf = configuration
|
||||||
|
|||||||
Reference in New Issue
Block a user