Add Warning when we cannot notify
Calling Notifier.audit() won't work with LogDriver as the logger does not have a audit level anymore, So let's at least not fail silently and let the operators know that we are dropping stuff on the floor. Closes-Bug: #1518170 Change-Id: I74002c72e6763ea8b5df7d97d722619bd4a1950b
This commit is contained in:
parent
5840ab3340
commit
6dba2ed591
@ -16,6 +16,7 @@
|
||||
# under the License.
|
||||
|
||||
import logging
|
||||
import warnings
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import strutils
|
||||
@ -40,3 +41,7 @@ class LogDriver(notifier.Driver):
|
||||
method = getattr(logger, priority.lower(), None)
|
||||
if method:
|
||||
method(strutils.mask_password(jsonutils.dumps(message)))
|
||||
else:
|
||||
warnings.warn('Unable to log message as notify cannot find a '
|
||||
'logger with the priority specified '
|
||||
'%s' % priority.lower())
|
||||
|
Loading…
x
Reference in New Issue
Block a user