Interface between tko parse and whatever the other client is for shipping out data.
OK to submit to non-main branch.
Signed-off-by: Darren Kuo <darrenkuo@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@4598 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/tko/parse.py b/tko/parse.py
index 640c02e..6f8bba9 100755
--- a/tko/parse.py
+++ b/tko/parse.py
@@ -157,6 +157,18 @@
# write the job into the database
db.insert_job(jobname, job)
+
+ # Serializing job into a binary file
+ try:
+ from autotest_lib.tko import tko_pb2
+ from autotest_lib.tko import job_serializer
+
+ serializer = job_serializer.JobSerializer()
+ serializer.serialize_to_binary(job, os.path.join(path, "job.serialize"))
+ except ImportError:
+ tko_utils.dprint("DEBUG: tko_pb2.py doesn't exist. Create by "
+ "compiling tko/tko.proto.")
+
db.commit()