[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. 0.51

David Steele dsteele at gmail.com
Wed May 15 10:09:34 UTC 2013


The following commit has been merged in the master branch:
commit 94de9edcd51bfa5c9ea6f9ebcfd29b54b9c67058
Author: David Steele <dsteele at gmail.com>
Date:   Fri Feb 22 18:06:20 2013 -0500

    detect_well_known_errors.py - Add has_problem() detection method.
    
    For a given Problem class instance, determine if a given log file
    body contains the problem.

diff --git a/master-bin/detect_well_known_errors.py b/master-bin/detect_well_known_errors.py
index 1b066d6..2d50655 100755
--- a/master-bin/detect_well_known_errors.py
+++ b/master-bin/detect_well_known_errors.py
@@ -64,6 +64,20 @@ class Problem():
 
         self.WHERE = self.WHERE.split(" ")
 
+    def has_problem(self, logbody, where):
+        """Does the log text 'logbody' contain this known problem?"""
+
+        if where in self.WHERE:
+
+            s = subprocess.Popen( self.COMMAND, stdin=subprocess.PIPE,
+                 stderr=subprocess.STDOUT, stdout=subprocess.PIPE, shell=True )
+            s.communicate( logbody )
+
+            if s.returncode != 1:
+                return( True )
+
+        return( False )
+
 def get_where( logpath ):
     """Convert a path to a log file to the 'where' component (e.g. 'pass')"""
     return( logpath.split('/')[-2] )

-- 
piuparts git repository



More information about the Piuparts-commits mailing list