Bug 833255

Summary: Don't configure Python's logging system implicitly
Product: [Retired] Pulp Reporter: Nick Coghlan <ncoghlan>
Component: z_otherAssignee: Jay Dobies <jason.dobies>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.0.6Keywords: Triaged
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-27 19:00:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.