Bug 833255 - Don't configure Python's logging system implicitly
Summary: Don't configure Python's logging system implicitly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: 2.0.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Jay Dobies
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-19 03:58 UTC by Nick Coghlan
Modified: 2012-06-27 19:00 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-27 19:00:44 UTC
Embargoed:


Attachments (Terms of Use)

Description Nick Coghlan 2012-06-19 03:58:13 UTC
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 19:00:44 UTC
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.