[Piuparts-commits] [piuparts] 16/51: dwke: new piuparts.conf setting 'exclude-known-problems'

Holger Levsen holger at layer-acht.org
Thu Jul 20 21:15:02 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 4c323f4553c3b0ec8d8efdff9e62fe219083ba14
Author: Andreas Beckmann <anbe at debian.org>
Date:   Mon Jun 19 03:16:17 2017 +0200

    dwke: new piuparts.conf setting 'exclude-known-problems'
    
    allows excluding some known problems for a section
    e.g. packages_have_been_kept_back_*.conf triggers on all
    --upgrade-before-dist-upgrade tests
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 README_server.txt                      |  5 +++++
 debian/changelog                       |  5 +++++
 master-bin/detect_well_known_errors.py | 17 ++++++++++++-----
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/README_server.txt b/README_server.txt
index b5ed3b4..ec85585 100644
--- a/README_server.txt
+++ b/README_server.txt
@@ -556,6 +556,11 @@ section, too, and will serve as defaults for all other sections
  is "none", the summary will not be created. The "json-sections"
  name "overall" is reserved.
 
+* "exclude-known-problems" (global, section) can be set to a list
+ of known_problems conffile names (including the .conf suffix) that
+ should not be used for this section. Useful if a known problem
+ triggers on (nearly) all logfiles.
+
 Some of the configuration items are not required, but it is best
 to set them all to be sure what the configuration actually is.
 
diff --git a/debian/changelog b/debian/changelog
index eda530b..a9656ae 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,6 +32,9 @@ piuparts (0.78) UNRELEASED; urgency=medium
     - Add new suites: buster, buster-rcmd, stretch2buster, stretch2buster-rcmd
     - Add new suites: stretch2bpo, stretch2bpo2buster for testing
       stretch-backports.
+    - New (per-section) conffile setting: 'exclude-known-problems' can be set
+      to a list of known problem iconffile names that should *not* be used for
+      this section.
   * piuparts.conf.anbe: Add some more example sections.
   * distros.conf: Add support for buster-debug, buster-proposed-updates.
   * piupartslib/packagesdb.py:
@@ -84,6 +87,8 @@ piuparts (0.78) UNRELEASED; urgency=medium
     - Report the issues found in each logfile.
     - Recognize more problems caused by a full filesystem.
     - Recognize more failures when connecting to databases.
+  * master-bin/detect_well_known_errors: Ignore known_problems conffiles
+    listed in 'exclude-known-problems' in piuparts.conf.
   * Add known_problems/trigger_cycle_error.conf to report trigger cycles and
     other trigger problems.
   * Add bug templates for failing to upgrade from stretch to buster.
diff --git a/master-bin/detect_well_known_errors.py b/master-bin/detect_well_known_errors.py
index a3346a5..c8f4307 100755
--- a/master-bin/detect_well_known_errors.py
+++ b/master-bin/detect_well_known_errors.py
@@ -40,15 +40,16 @@ class WKE_Config(piupartslib.conf.Config):
 
     """Configuration parameters for Well Known Errors"""
 
-    def __init__(self):
-        self.section = 'global'
-
-        piupartslib.conf.Config.__init__(self, self.section,
+    def __init__(self, section="global", defaults_section=None):
+        self.section = section
+        piupartslib.conf.Config.__init__(self, section,
                                          {
                                          "sections": "report",
                                          "master-directory": ".",
                                          "known-problem-directory": "@sharedir@/piuparts/known_problems",
-                                         }, "")
+                                         "exclude-known-problems": None,
+                                         },
+                                         defaults_section=defaults_section)
 
 
 def setup_logging(log_level):
@@ -142,6 +143,12 @@ def process_section(section, config, problem_list,
 
     kprdict = get_file_dict(workdirs, KPR_EXT)
 
+    section_config = WKE_Config(section=section, defaults_section="global")
+    section_config.read(CONFIG_FILE)
+    if section_config['exclude-known-problems']:
+        excluded = section_config['exclude-known-problems'].split()
+        problem_list = [p for p in problem_list if p.name not in excluded]
+
     add_cnt = make_kprs(logdict, kprdict, problem_list)
 
     failures = FailureManager(logdict)

-- 
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