Fix no logfile exception in buildcheck job
authorLin Yang <lin.a.yang@intel.com>
Thu, 31 Oct 2013 07:55:47 +0000 (15:55 +0800)
committerGerrit Code Review <gerrit2@otctools.jf.intel.com>
Sun, 3 Nov 2013 18:41:55 +0000 (10:41 -0800)
If obs package is in some states, like unresolvable, it will throw exception
when try to fetch build log for this package. And we need to send out build log
only for build failed package.

Fixes: #1429

Change-Id: I3f3754bc7200b15d720d8f23de86015110cd426f
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
job_buildcheck_post.py

index d767a70..65690a4 100755 (executable)
@@ -85,7 +85,7 @@ def main():
     for arch in build_results[repo]:
         msg = msg + '\n\n %-15s%-15s%-15s' % (repo, arch, \
                 build_results[repo][arch])
-        if build_results[repo][arch] != 'succeeded' and \
+        if build_results[repo][arch] == 'failed' and \
                 git_info.has_key('OWNER_EMAIL') and git_info['OWNER_EMAIL']:
             log = temp_build.get_build_log(repo, arch)
             # write log to a file as attachment