Fix distributed schedule to handle old style jobs. R12/R13/etc.

The new distributed scheduling changes don't play well with older style
jobs from R12 and R13. I've added some code to convert them to the new
style attribute dictionary.

BUG=none
TEST=run_remote_tests w/ R13+R14 control files.

Change-Id: I37faaeb957f1fcf00fa7c1ef0150c528a368c0bf
Reviewed-on: http://gerrit.chromium.org/gerrit/4031
Reviewed-by: Mike Truty <truty@chromium.org>
Tested-by: Dale Curtis <dalecurtis@chromium.org>
diff --git a/server/site_server_job.py b/server/site_server_job.py
index 0695c9c..be5208c 100644
--- a/server/site_server_job.py
+++ b/server/site_server_job.py
@@ -117,6 +117,17 @@
         # Only queue tests which are valid on at least one machine.  Record
         # skipped tests in the status.log file using record_skipped_test().
         for test_entry in tests:
+            # Check if it's an old style test entry.
+            if len(test_entry) > 2 and not isinstance(test_entry[2], dict):
+                test_attribs = {'include': test_entry[2]}
+                if len(test_entry) > 3:
+                    test_attribs['exclude'] = test_entry[3]
+                if len(test_entry) > 4:
+                    test_attribs['attributes'] = test_entry[4]
+
+                test_entry = list(test_entry[:2])
+                test_entry.append(test_attribs)
+
             ti = site_server_job_utils.test_item(*test_entry)
             machine_found = False
             for ma in unique_machine_attributes: