Only get last 200 lines of build log
authorLin Yang <lin.a.yang@intel.com>
Wed, 6 Feb 2013 08:35:38 +0000 (16:35 +0800)
committerLin Yang <lin.a.yang@intel.com>
Thu, 28 Feb 2013 08:00:35 +0000 (16:00 +0800)
Change-Id: Ie382e1f7137b4d6680491eb680a91e01bd854cdc
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
common/tempbuildpkg.py

index 3a4b56b..90ff57b 100644 (file)
@@ -194,7 +194,8 @@ class TempPackageBuild:
     def get_build_log(self, repo, arch):
         """ try to return build log, any except is assumed no build on OBS """
         try:
-            return self.bs.getBuildLog(self.project, "%s/%s" %(repo, arch), self.package)
+            # get last 200 lines if build log exceed 200 lines
+            return '\n'.join(self.bs.getBuildLog(self.project, "%s/%s" %(repo, arch), self.package).splitlines()[-200:])
         except:
             return "No build log"