The NullHandler and StandardLogging test fixtures don't appear to be detecting formatting errors
Bug #1493980 reported by
Matt Riedemann
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
We have the NullHandler and StandardLogging fixtures here to detect formatting errors in the nova logs:
http://
We've seen a few bugs recently where we weren't substituting variables in the log messages but didn't notice until after the fact:
https:/
https:/
It also appears we should be using the logging_error fixture from oslo.log:
http://
Changed in nova: | |
status: | In Progress → Won't Fix |
assignee: | Matt Riedemann (mriedem) → nobody |
importance: | Medium → Undecided |
To post a comment you must log in.
To test this, I made a change like this:
And then ran a unit test that I know hits that code and it failed:
nova.tests. unit.network. test_manager. NetworkManagerN oDBTestCase. test_deallocate _fixed_ ip_explicit_ disassociate ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -----
-------
Captured traceback: mriedem/ git/nova/ .tox/py27/ local/lib/ python2. 7/site- packages/ mock/mock. py", line 1305, in patched unit/network/ test_manager. py", line 3643, in test_deallocate _fixed_ ip_explicit_ disassociate mriedem/ git/nova/ .tox/py27/ local/lib/ python2. 7/site- packages/ mock/mock. py", line 1305, in patched unit/network/ test_manager. py", line 3635, in do_test
self.context, fip['address'], instance=fake_inst) manager. py", line 1090, in deallocate_fixed_ip
instance= instance) mriedem/ git/nova/ .tox/py27/ local/lib/ python2. 7/site- packages/ oslo_utils/ excutils. py", line 195, in __exit__
six.reraise( self.type_ , self.value, self.tb) manager. py", line 1078, in deallocate_fixed_ip
instance_ uuid=instance_ uuid) python2. 7/logging/ __init_ _.py", line 1425, in debug
self.logger. debug(msg, *args, **kwargs) python2. 7/logging/ __init_ _.py", line 1140, in debug
self._ log(DEBUG, msg, args, **kwargs) python2. 7/logging/ __init_ _.py", line 1271, in _log
self.handle( record) python2. 7/logging/ __init_ _.py", line 1281, in handle
self.callHandl ers(record) python2. 7/logging/ __init_ _.py", line 1321, in callHandlers
hdlr.handle( record) fixtures. py", line 69, in handle
self.format( record) python2. 7/logging/ __init_ _.py", line 724, in format python2. 7/logging/ __init_ _.py", line 464, in format
record. message = record.getMessage() python2. 7/logging/ __init_ _.py", line 328, in getMessage
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "/home/
return func(*args, **keywargs)
File "nova/tests/
do_test()
File "/home/
return func(*args, **keywargs)
File "nova/tests/
File "nova/network/
File "/home/
File "nova/network/
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
File "/usr/lib/
File "nova/tests/
File "/usr/lib/
return fmt.format(record)
File "/usr/lib/
File "/usr/lib/
msg = msg % self.args
TypeError: format requires a mapping