Yet another round of extraction of job code up into base_job.py in the common
library. This focuses on pulling job.record up from the client job into the
base, with an eye towards doing the same with the server job.record code (thus
providing a single unified implementation).

Currently I extracted all the job.record code from the client out into a
status_log_entry and status_logger class. The idea was that all the code that
knows how to convert status,subdir,operation,etc. parameters into a string to
go into the status log would be in the status_log_entry class, and all the
code that actually knows how to write an entry into the log files would be in
the status_logger class. It also pulls all the code for tracking the nesting
into the status_logger class, instead of scattering increment and decrement
calls throughout the job class.

This multi-class separation might seem a little overdesigned, but it made it
easier to write good unit tests that don't throw up a million mocks
all over the place. I also think it will be easier to extend when I
try to make this work for server jobs as well; the server has to mix
together job.record calls, status logs from client jobs, and injected
WARNs, so separating out the entry class and the class that actually
writes out the logs should be helpful for supporting that model.

The CL also contains a lot of generic docstring cleanup that I had to do
while working on the classes.

Signed-off-by: John Admanski <jadmanski@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4455 592f7852-d20e-0410-864c-8624ca9c26a4
4 files changed