[Piuparts-commits] [piuparts] 02/06: dwke: do not instantiate unused FailureManager

Holger Levsen holger at layer-acht.org
Sun Sep 17 14:06:44 UTC 2017


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit dddb0a95cc8247e6a13e24e77d5a913bd72cb399
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sat Sep 16 23:02:15 2017 +0200

    dwke: do not instantiate unused FailureManager
    
    causes lots of I/Os for reading *.kpr only for printing the statistics
    
    the statistics can be printed from piuparts-report, which actually
    uses the FailureManager it creates
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 master-bin/detect_well_known_errors.py | 11 ++---------
 piuparts-report.py                     |  5 +++++
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/master-bin/detect_well_known_errors.py b/master-bin/detect_well_known_errors.py
index a43927d..2be5cc4 100644
--- a/master-bin/detect_well_known_errors.py
+++ b/master-bin/detect_well_known_errors.py
@@ -89,9 +89,7 @@ def process_section(section, config, problem_list,
 
         add_cnt = make_kprs(logdict, kprdict, problem_list)
 
-        failures = FailureManager(logdict)
-
-        return (del_cnt, add_cnt, failures)
+        return (del_cnt, add_cnt)
 
 
 def detect_well_known_errors(sections, config, problem_list, recheck, recheck_failed):
@@ -101,16 +99,11 @@ def detect_well_known_errors(sections, config, problem_list, recheck, recheck_fa
             logging.info(time.strftime("%a %b %2d %H:%M:%S %Z %Y", time.localtime()))
             logging.info("%s:" % section)
 
-            (del_cnt, add_cnt, failures) = \
+            (del_cnt, add_cnt) = \
                 process_section(section, config, problem_list,
                                 recheck, recheck_failed)
 
             logging.info("parsed logfiles: %d removed, %d added" % (del_cnt, add_cnt))
-
-            for prob in problem_list:
-                pcount = len(failures.filtered(prob.name))
-                if pcount:
-                    logging.info("%7d %s" % (pcount, prob.name))
         except MissingSection:
             pass
 
diff --git a/piuparts-report.py b/piuparts-report.py
index 4fae8b3..c2f7a5a 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -1722,6 +1722,11 @@ def dwke_process_section(section, sectiondir, htmldir, problem_list, pkgsdb):
     failures = FailureManager(logdict)
     failures.sort_by_bugged_and_rdeps(pkgsdb)
 
+    for prob in problem_list:
+        pcount = len(failures.filtered(prob.name))
+        if pcount:
+            logging.info("%7d %s" % (pcount, prob.name))
+
     update_html(section, htmldir, logdict, problem_list, failures, pkgsdb)
 
 # END detect_well_known_errors

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list