TypeError when use logging.LogRecord

Bug #1870281 reported by uchenily
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.privsep
In Progress
Undecided
uchenily

Bug Description

I found EypeError in oslo.privsep:

Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/dist-packages/oslo_privsep/comm.py", line 131, in _reader_main
    self.out_of_band(data)
  File "/usr/local/lib/python3.6/dist-packages/oslo_privsep/daemon.py", line 210, in out_of_band
    if LOG.isEnabledFor(record.levelno):
  File "/usr/lib/python3.6/logging/__init__.py", line 1680, in isEnabledFor
    if self.logger.manager.disable >= level:
TypeError: '>=' not supported between instances of 'int' and 'NoneType'

environment info:
python: 3.6.7
oslo.privsep: 1.29.2

this simple bug causes nova-compute to not work properly. [1]is a related bug.

if it's ok, I will fix it later.

[1] https://bugs.launchpad.net/oslo.privsep/+bug/1696772

Revision history for this message
uchenily (uchenily) wrote :

https://github.com/openstack/oslo.privsep/blob/1.29.2/oslo_privsep/daemon.py#L210

I think here we can use:
```
if record.levelno and LOG.isEnabledFor(record.levelno):
```
because record.levelno maybe NoneType

uchenily (uchenily)
Changed in oslo.privsep:
status: New → Confirmed
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.privsep (master)

Fix proposed to branch: master
Review: https://review.opendev.org/716873

Changed in oslo.privsep:
assignee: nobody → uchenily (uchenily)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on oslo.privsep (master)

Change abandoned by "Daniel Bengtsson <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/oslo.privsep/+/716873
Reason: No update for a long time.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.