diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2018-04-13 09:13:16 -0400 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2018-05-02 11:28:46 +0000 |
commit | 4e7b423d3c3137c3f83b71b36279e1a544154833 (patch) | |
tree | e59dc57aa319a5e145161a0e32fba9fc74773e91 /extras/failed-tests.py | |
parent | 9da91172538a2a95fba609c93e199db159fd1938 (diff) |
core/various: python3 compat, prepare for python2 -> python3
see https://review.gluster.org/#/c/19788/
use print fn from __future__
Change-Id: If5075d8d9ca9641058fbc71df8a52aa35804cda4
updates: #411
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'extras/failed-tests.py')
-rwxr-xr-x | extras/failed-tests.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/extras/failed-tests.py b/extras/failed-tests.py index 8391d229b45..1ef1a954f4f 100755 --- a/extras/failed-tests.py +++ b/extras/failed-tests.py @@ -1,5 +1,6 @@ #!/usr/bin/python2 +from __future__ import print_function import blessings import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning @@ -25,7 +26,7 @@ def process_failure(url, node): if t.find("Result: FAIL") != -1: for t2 in accum: if VERBOSE: - print t2.encode('utf-8') + print(t2.encode('utf-8')) if t2.find("Wstat") != -1: test_case = re.search('\./tests/.*\.t', t2) if test_case: @@ -69,26 +70,26 @@ def print_summary(failed_builds, total_builds, html=False): template = 0 if html: template = 1 - print render( + print(render( count[template], {'failed': failed_builds, 'total': total_builds} - ) + )) for k, v in summary.iteritems(): if k == 'core': - print ''.join([TERM.red, "Found cores:", TERM.normal]) + print(''.join([TERM.red, "Found cores:", TERM.normal])) for comp, link in zip(v[::2], v[1::2]): - print render(component[template], {'comp': comp}) - print render( + print(render(component[template], {'comp': comp})) + print(render( regression_link[template], {'link': link[0], 'node': link[1]} - ) + )) else: - print render(failure_count[template], {'test': k, 'count': len(v)}) + print(render(failure_count[template], {'test': k, 'count': len(v)})) for link in v: - print render( + print(render( regression_link[template], {'link': link[0], 'node': link[1]} - ) + )) def get_summary(cut_off_date, reg_link): @@ -114,11 +115,11 @@ def get_summary(cut_off_date, reg_link): success_count += 1 continue if VERBOSE: - print ''.join([ + print(''.join([ TERM.red, 'FAILURE on {0}'.format(build['url']), TERM.normal - ]) + ])) url = ''.join([build['url'], 'consoleText']) failure_count += 1 process_failure(url, build['builtOn']) |