summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-09-20 07:32:35 +0000
committerGerrit Code Review <review@openstack.org>2014-09-20 07:32:35 +0000
commitcc6ca0d1846dc48be1b9a98177d99f86255433c0 (patch)
treedfe9a129af6dd323c25e75fa373c43a8a2403b85 /tools
parent26fa3d72d47edfd6efda0a1f2b253d62342b4b7c (diff)
parent1179205dbc5cdbe9d8483cae0a6726fa172216d9 (diff)
downloadtempest-cc6ca0d1846dc48be1b9a98177d99f86255433c0.tar.gz
Merge "Make output from check_logs less verbose"
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check_logs.py28
1 files changed, 13 insertions, 15 deletions
diff --git a/tools/check_logs.py b/tools/check_logs.py
index 917aaaf90..7cf9d8573 100755
--- a/tools/check_logs.py
+++ b/tools/check_logs.py
@@ -80,7 +80,6 @@ def process_files(file_specs, url_specs, whitelists):
def scan_content(name, content, regexp, whitelist):
had_errors = False
- print_log_name = True
for line in content:
if not line.startswith("Stderr:") and regexp.match(line):
whitelisted = False
@@ -91,13 +90,8 @@ def scan_content(name, content, regexp, whitelist):
whitelisted = True
break
if not whitelisted or dump_all_errors:
- if print_log_name:
- print("\nLog File Has Errors: %s" % name)
- print_log_name = False
if not whitelisted:
had_errors = True
- print("*** Not Whitelisted ***"),
- print(line.rstrip())
return had_errors
@@ -151,17 +145,21 @@ def main(opts):
whitelists = loaded
logs_with_errors = process_files(files_to_process, urls_to_process,
whitelists)
- if logs_with_errors:
- print("Logs have errors")
- if is_grenade:
- print("Currently not failing grenade runs with errors")
- return 0
+
failed = False
- for log in logs_with_errors:
- if log not in allowed_dirty:
- print("Log: %s not allowed to have ERRORS or TRACES" % log)
- failed = True
+ if logs_with_errors:
+ log_files = set(logs_with_errors)
+ for log in log_files:
+ msg = '%s log file has errors' % log
+ if log not in allowed_dirty:
+ msg += ' and is not allowed to have them'
+ failed = True
+ print(msg)
+ print("\nPlease check the respective log files to see the errors")
if failed:
+ if is_grenade:
+ print("Currently not failing grenade runs with errors")
+ return 0
return 1
print("ok")
return 0