-
Task
-
Resolution: Done-Errata
-
Normal
-
None
-
None
-
False
-
True
-
1
-
2023-Q1
When we started using DBus, we noticed that the DBus library set a root logging handler in its library code (contrary to Python best practices). This caused the messages that we sent to our logger to be logged twice, once by our handler and once by the DBus one. We worked around this by adding a NullHandler logging handler to the logging.py file. This handler is initialized when logger.py is imported.
While this works, it is a little fragile. This code must be run before dbus is imported which is currently the case with logger.py but it's not guaranteed. To remedy this, we should move it to a dedicated early-startup intialization phase. rolivier@redhat.com is introducing an early-startup phase in his merge yum transactions PR that we could use here.
Implementation
- Wait for initialize.py from Rodolfo's yum merge transaction PR to be merged:
- https://github.com/oamg/convert2rhel/pull/528/files#diff- 19248faf3b5a18c5a43cef0f6dc341e49cd42f408a3d7af7fa10105fa7e638bbR1
- Move the block of code dealing with NullHandler logging from the toplevel of logger.py to a function inside of initialize.py:
- Have the initialize.run() method call the new function.