From e3c1a3ae51f1a29e7bed1c7504b20f26050906c4 Mon Sep 17 00:00:00 2001 From: jadmanski Date: Wed, 6 May 2009 20:25:46 +0000 Subject: Use a set instead of a list to store currently running reasons, and sort it when combining multiple entries into a string. This eliminates duplicates and forces a "standard" ordering. Risk: Low Visibility: Eliminate duplicate warnings from the status log. Signed-off-by: John Admanski git-svn-id: svn://test.kernel.org/autotest/trunk@3093 592f7852-d20e-0410-864c-8624ca9c26a4 --- tko/parsers/version_1.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tko/parsers') diff --git a/tko/parsers/version_1.py b/tko/parsers/version_1.py index 1e06878c..c78bab7f 100644 --- a/tko/parsers/version_1.py +++ b/tko/parsers/version_1.py @@ -179,7 +179,7 @@ class parser(base.parser): started_time_stack = [None] subdir_stack = [None] running_test = None - running_reasons = [] + running_reasons = set() yield [] # we're ready to start running # create a RUNNING SERVER_JOB entry to represent the entire test @@ -258,9 +258,9 @@ class parser(base.parser): min_stack_size = stack.size() elif stack.size() == min_stack_size + 1 and not running_test: # we just started a new test, insert a running record - running_reasons = [] + running_reasons = set() if line.reason: - running_reasons.append(line.reason) + running_reasons.add(line.reason) running_test = test.parse_partial_test(self.job, line.subdir, line.testname, @@ -291,8 +291,9 @@ class parser(base.parser): if line.reason: # update the status of a currently running test if running_test: - running_reasons.append(line.reason) - running_test.reason = ", ".join(running_reasons) + running_reasons.add(line.reason) + sorted_reasons = sorted(running_reasons) + running_test.reason = ", ".join(sorted_reasons) current_reason = running_test.reason new_tests.append(running_test) msg = "update RUNNING reason: %s" % line.reason -- cgit v1.2.3