for arch in status[build_repo]:
stat = status[build_repo][arch]
results.append('%-15s%-15s%-15s' % (build_repo, arch, stat))
- log.info('build results from build server:\n%s' \
- % '\n'.join(results))
+ if results:
+ log.info('build results from build server:\n%s' \
+ % '\n'.join(results))
+ else:
+ log.info('no build results from build server')
return 0
except OSCError, err:
"""
import os
+import re
import urllib2
import M2Crypto
from M2Crypto.SSL.Checker import SSLVerificationError
% (prj, pkg, str(err)))
for res in build_status:
- repo, arch, status = res.split()
- results[repo][arch] = status
+ # This regular expression is created for parsing the
+ # results of of core.get_results()
+ stat_re = re.compile(r'^(?P<repo>\S+)\s+(?P<arch>\S+)\s+'
+ '(?P<status>\S*)$')
+ mo = stat_re.match(res)
+ if mo:
+ results[mo.group('repo')][mo.group('arch')] = mo.group('status')
+ else:
+ logger.warning('not valid build status received: %s' % res)
+
return results
def get_buildlog(self, prj, pkg, repo, arch):