[oe-commits] Lucian Musat : oeqa/parselogs: Fixed a problem in parselogs

git at git.openembedded.org git at git.openembedded.org
Fri Jun 26 13:02:15 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: 845c9f870862f714c4bb25e0ccb506d38a1307b6
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=845c9f870862f714c4bb25e0ccb506d38a1307b6

Author: Lucian Musat <george.l.musat at intel.com>
Date:   Fri Jun 26 13:36:40 2015 +0300

oeqa/parselogs: Fixed a problem in parselogs

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 at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/lib/oeqa/runtime/parselogs.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/runtime/parselogs.py b/meta/lib/oeqa/runtime/parselogs.py
index a9ab9a3..7095a36 100644
--- a/meta/lib/oeqa/runtime/parselogs.py
+++ b/meta/lib/oeqa/runtime/parselogs.py
@@ -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.



More information about the Openembedded-commits mailing list