[yum-commits] 2 commits - utils.py yummain.py

zpavlas at osuosl.org zpavlas at osuosl.org
Tue Jun 19 14:03:27 UTC 2012


 utils.py   |   12 +++++-------
 yummain.py |    6 ++----
 2 files changed, 7 insertions(+), 11 deletions(-)

New commits:
commit 61002fb585fd59ff99b77180b28ff3d27f0dc755
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date:   Tue Jun 19 09:28:04 2012 +0200

    show_lock_owner: report errors if we fail.  BZ 745281

diff --git a/utils.py b/utils.py
index 08b09fb..e465cf7 100755
--- a/utils.py
+++ b/utils.py
@@ -93,12 +93,6 @@ def get_process_info(pid):
     except ValueError, e:
         return
         
-    # Maybe true if /proc isn't mounted, or not Linux ... or something.
-    if (not os.path.exists("/proc/%d/status" % pid) or
-        not os.path.exists("/proc/stat") or
-        not os.path.exists("/proc/%d/stat" % pid)):
-        return
-
     ps = {}
     for line in open("/proc/%d/status" % pid):
         if line[-1] != '\n':
@@ -146,7 +140,11 @@ def show_lock_owner(pid, logger):
        This is the same as the dictionary returned by
        :func:`get_process_info`.
     """
-    ps = get_process_info(pid)
+    try:
+        ps = get_process_info(pid)
+    except IOError, e:
+        logger.critical("%s", exception2msg(e))
+        ps = None
     if not ps:
         return None
 
commit c9d84d0df02161c3ec1ba4b1be38c0058bb42d47
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date:   Mon Jun 18 11:47:54 2012 +0200

    Do not flood the screen when we can't show the lock owner. BZ 745281
    
    get_lock_owner() returns a valid locker PID (not a zombie process)
    but get_process_info(PID) fails.  This needs more investigation.
    At least, make the locker PID readable by not flooding the screen.

diff --git a/yummain.py b/yummain.py
index e3a232b..648cf86 100755
--- a/yummain.py
+++ b/yummain.py
@@ -132,10 +132,8 @@ def main(args):
 
             if not base.conf.exit_on_lock:
                 logger.critical(_("Another app is currently holding the yum lock; waiting for it to exit..."))
-                tm = 0.1
-                if show_lock_owner(e.pid, logger):
-                    tm = 2
-                time.sleep(tm)
+                show_lock_owner(e.pid, logger)
+                time.sleep(2)
             else:
                 logger.critical(_("Another app is currently holding the yum lock; exiting as configured by exit_on_lock"))
                 return 1


More information about the Yum-commits mailing list