Bug 833255 - Don't configure Python's logging system implicitly
Don't configure Python's logging system implicitly
Product: Pulp
Classification: Community
Component: z_other (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jay Dobies
Preethi Thomas
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2012-06-18 23:58 EDT by Nick Coghlan
Modified: 2012-06-27 15:00 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-06-27 15:00:44 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Nick Coghlan 2012-06-18 23:58:13 EDT
Python's logging system should *never* be configured implicitly - it should always be done explicitly from __main__ (or the equivalent for web services).

Currently, pulp components are painful to use as part of a larger application (or from a utility script), as it is necessary to monkeypatch pulp to remove the implicit initialisation of the logging system [1] to avoid logging to the wrong location (or to a location where the current user may not even have write permissions leading to a script failing with permission errors).

[1] http://git.fedorahosted.org/git/?p=pulpdist.git;a=blob;f=src/pulpdist/core/pulpapi.py;h=f81727a90806c319b0545db23233abc05109debb;hb=HEAD#l18
Comment 1 Jay Dobies 2012-06-27 15:00:44 EDT
I've already decoupled this in the 2.0 codebase. The entire logutil module doesn't exist anymore. Should be much more usable in anything after build .304.

Note You need to log in before you can comment on or make changes to this bug.