The parser cleanup should be idempotent. Also, renamed from _cleanup
to cleanup_parser to make it clearer exactly what it's cleaning up.
Signed-off-by: John Admanski <jadmanski@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1449 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/autoserv b/server/autoserv
index a8f4c8a..a3a9683 100755
--- a/server/autoserv
+++ b/server/autoserv
@@ -156,7 +156,7 @@
try:
job.run(reboot, install_before, install_after)
finally:
- job._cleanup()
+ job.cleanup_parser()
except:
job.aborted = True
traceback.print_exc()
diff --git a/server/server_job.py b/server/server_job.py
index 5b92cab..282bbdc 100755
--- a/server/server_job.py
+++ b/server/server_job.py
@@ -208,7 +208,7 @@
self.job_model.machine_idx = machine_idx
- def _cleanup(self):
+ def cleanup_parser(self):
"""This should be called after the server job is finished
to carry out any remaining cleanup (e.g. flushing any
remaining test results to the results db)"""
@@ -217,6 +217,7 @@
final_tests = self.parser.end()
for test in final_tests:
self.results_db.insert_test(self.job_model, test)
+ self.using_parser = False
def verify(self):
@@ -280,7 +281,7 @@
machine)
self.init_parser(self.resultdir)
result = function(machine)
- self._cleanup()
+ self.cleanup_parser()
return result
else:
wrapper = function