diff options
author | Chris Lumens <clumens@redhat.com> | 2005-10-11 19:28:16 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2005-10-11 19:28:16 +0000 |
commit | 3c50a0d576253a198582c9204a82c2c864a478e1 (patch) | |
tree | 0119f307ffb8fbd1aefce031743b9521791f1fb3 /anaconda | |
parent | cdb1df35fc38e9425be9a84c3e72586a0c01ac9b (diff) | |
download | anaconda-3c50a0d576253a198582c9204a82c2c864a478e1.tar.gz anaconda-3c50a0d576253a198582c9204a82c2c864a478e1.tar.xz anaconda-3c50a0d576253a198582c9204a82c2c864a478e1.zip |
Move redirection of warnings module messages from kickstart.py to anaconda
so all deprecation warnings will end up getting logged.
Diffstat (limited to 'anaconda')
-rwxr-xr-x | anaconda | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -31,6 +31,10 @@ import sys, os miniwm_pid = None +# Make sure messages sent through python's warnings module get logged. +def AnacondaShowWarning(message, category, filename, lineno, file=sys.stderr): + log.warning("%s" % warnings.formatwarning(message, category, filename, lineno)) + # start miniWM def startMiniWM(root='/'): (rd, wr) = os.pipe() @@ -281,7 +285,7 @@ def setupPythonUpdates(): pass for pypkg in ("rhpl", "yum", "rpmUtils", "urlgrabber", "repomd", - "pykickstart"): + "pykickstart", "rhpxl"): # get the libdir. *sigh* if os.access("/usr/lib64/python%s/site-packages/%s" %(pyver, pypkg), os.X_OK): @@ -358,12 +362,13 @@ if len(sys.argv) > 1: setupPythonUpdates() import signal, traceback, string, isys, iutil, time - from exception import handleException import dispatch +import warnings import logging from anaconda_log import logger from flags import flags +from rhpl.translate import _, textdomain, addPoPath log = logging.getLogger("anaconda") stdoutLog = logging.getLogger("anaconda.stdout") @@ -371,7 +376,7 @@ stdoutLog = logging.getLogger("anaconda.stdout") if iutil.getArch() != "s390" and os.access("/dev/tty3", os.W_OK): logger.addFileHandler ("/dev/tty3", log) -from rhpl.translate import _, textdomain, addPoPath +warnings.showwarning = AnacondaShowWarning if os.path.isdir("/mnt/source/RHupdates/po"): log.info("adding RHupdates/po") |