]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/parselogs: Fixed a problem in parselogs
authorLucian Musat <george.l.musat@intel.com>
Fri, 26 Jun 2015 10:36:40 +0000 (13:36 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 27 Jun 2015 21:42:00 +0000 (22:42 +0100)
When the test passed it returned an error because
grep did not return any error and the variable that
held the results was being referenced but not
assigned any value.

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/parselogs.py

index a9ab9a3462052687cc2b5cbd86cdfe0bb3e4ec3a..7095a365b4ac05cde0c64bce6ff18a720fe26625 100644 (file)
@@ -198,6 +198,7 @@ class ParseLogsTest(oeRuntimeTest):
     def parse_logs(self, errors, ignore_errors, logs, lines_before = 10, lines_after = 10):
         results = {}
         rez = []
+        grep_output = ''
         for log in logs:
             result = None
             thegrep = self.build_grepcmd(errors, ignore_errors, log)
@@ -211,10 +212,10 @@ class ParseLogsTest(oeRuntimeTest):
                 for xrez in rez:
                     command = "grep \"\\"+str(xrez)+"\" -B "+str(lines_before)+" -A "+str(lines_after)+" "+str(log)
                     try:
-                        yrez = subprocess.check_output(command, shell=True)
+                        grep_output = subprocess.check_output(command, shell=True)
                     except:
                         pass
-                    results[log.replace('target_logs/','')][xrez]=yrez
+                    results[log.replace('target_logs/','')][xrez]=grep_output
         return results
 
     #get the output of dmesg and write it in a file. This file is added to log_locations.