[yum-commits] Branch 'yum-3_2_X' - 2 commits - yum/__init__.py yum/logginglevels.py

skvidal at osuosl.org skvidal at osuosl.org
Fri Apr 30 20:09:37 UTC 2010


 yum/__init__.py      |    7 ++++++-
 yum/logginglevels.py |    7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit a4f5edddc317cec91c83219485f4dd183accbbd4
Author: Mads Kiilerich <mads at kiilerich.com>
Date:   Fri Apr 30 15:21:32 2010 -0400

    if we get diskspace errors from runTransaction but not from the test
    transaction then emit them quasi-properly.
    
    I'd love it if this were all different and less error prone to sort out.
    modified patch from https://bugzilla.redhat.com/show_bug.cgi?id=516135

diff --git a/yum/__init__.py b/yum/__init__.py
index 0a39365..eb135f4 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1297,7 +1297,12 @@ class YumBase(depsolve.Depsolve):
             if self.conf.history_record:
                 herrors = [to_unicode(to_str(x)) for x in errors]
                 self.history.end(rpmdbv, 2, errors=herrors)
-            raise Errors.YumBaseError, errors
+            
+            self.logger.critical(_("Transaction couldn't start:"))
+            for e in errors:
+                self.logger.critical(e[0]) # should this be 'to_unicoded'?
+            raise Errors.YumBaseError, _("Could not run transaction.")
+
                           
         if not self.conf.keepcache:
             self.cleanUsedHeadersPackages()
commit b3be8de9105015e2e321816906c312d98a38e6e6
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Fri Apr 30 14:36:25 2010 -0400

    if the log file doesn't exist when we startup make sure we set
    the perms for it to 0600.
    close rh bug https://bugzilla.redhat.com/show_bug.cgi?id=552549

diff --git a/yum/logginglevels.py b/yum/logginglevels.py
index 1ab11db..2002140 100644
--- a/yum/logginglevels.py
+++ b/yum/logginglevels.py
@@ -192,7 +192,12 @@ def setFileLog(uid, logfile):
             logdir = os.path.dirname(logfile)
             if not os.path.exists(logdir):
                 os.makedirs(logdir, mode=0755)
-
+            
+            if not os.path.exists(logfile):
+                f = open(logfile, 'w')
+                os.chmod(logfile, 0600) # making sure umask doesn't catch us up
+                f.close()
+                
             filelogger = logging.getLogger("yum.filelogging")
             filehandler = logging.FileHandler(logfile)
             formatter = logging.Formatter("%(asctime)s %(message)s",


More information about the Yum-commits mailing list