[PATCH] Don't open anaconda logs for appending.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This prevents live installs from having log files that just grow and
grow every time the user restarts liveinst.
---
 pyanaconda/anaconda_log.py |    2 +-
 pyanaconda/yuminstall.py   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/anaconda_log.py b/pyanaconda/anaconda_log.py
index 04dea8d..9be016e 100644
--- a/pyanaconda/anaconda_log.py
+++ b/pyanaconda/anaconda_log.py
@@ -167,7 +167,7 @@ class AnacondaLog:
                         fmtStr=ENTRY_FORMAT,
                         autoLevel=False):
         if isinstance(file, types.StringTypes):
-            logfileHandler = logging.FileHandler(file)
+            logfileHandler = logging.FileHandler(file, "w")
         else:
             logfileHandler = logging.StreamHandler(file)
 
diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
index fe88586..dec146e 100644
--- a/pyanaconda/yuminstall.py
+++ b/pyanaconda/yuminstall.py
@@ -741,7 +741,7 @@ class AnacondaYum(yum.YumBase):
 
         import yum.logginglevels
 
-        file_handler = logging.FileHandler("/tmp/yum.log")
+        file_handler = logging.FileHandler("/tmp/yum.log", "w")
         file_formatter = logging.Formatter("[%(asctime)s] %(levelname)-8s: %(message)s")
         file_handler.setFormatter(file_formatter)
 
-- 
1.7.4.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux