[autotest] Thread priority from create_suite_job through to create_job.

This schedules a suite job itself at the same priority level of its
tests, and also injects the priority value into the suite control files.

The change to thread priority through from dynamic_suite into create_job
needs to happen concurrently, because the type of `priority` is changing
from a string to an int.  This also means everything that passes in a
priority gets fixed up in this CL.

suite_scheduler has also been tweaked to schedule all tests at the
PostBuild priority (for now...).

This also does all of the work to get priority to show up by name
instead of by integral value.  In the create_job pane, we disallow
anyone to schedule a job at a priority that would preempt major build
processes (anything coming from a waterfall).  However, all old jobs are
shown at the integral value, because showing two seperate priority
scales at the same time would be incredibly confusing.  (Especially
since URGENT would be incredibly low priority)

BUG=chromium:250583
DEPLOY=afe, apache, suite_scheduler
TEST=unit, run_suite with a priority level

Change-Id: I9ecf5ceed5c58bd8ee0815c6d15f4aba300082fe
Reviewed-on: https://chromium-review.googlesource.com/168143
Reviewed-by: Alex Miller <milleral@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
Commit-Queue: Alex Miller <milleral@chromium.org>
diff --git a/frontend/afe/rpc_interface.py b/frontend/afe/rpc_interface.py
index fe141be..3702ad5 100644
--- a/frontend/afe/rpc_interface.py
+++ b/frontend/afe/rpc_interface.py
@@ -33,7 +33,7 @@
 
 import datetime
 import common
-from autotest_lib.client.common_lib import error
+from autotest_lib.client.common_lib import error, priorities
 from autotest_lib.frontend.afe import models, model_logic, model_attributes
 from autotest_lib.frontend.afe import control_file, rpc_utils
 from autotest_lib.site_utils.graphite import stats
@@ -508,7 +508,7 @@
     Create and enqueue a job.
 
     @param name name of this job
-    @param priority Low, Medium, High, Urgent
+    @param priority Integer priority of this job.  Higher is more important.
     @param control_file String contents of the control file.
     @param control_type Type of control file, Client or Server.
     @param synch_count How many machines the job uses per autoserv execution.
@@ -886,10 +886,10 @@
                                  name=default_drone_set_name)))
 
     result = {}
-    result['priorities'] = models.Job.Priority.choices()
-    default_priority = job_fields['priority'].default
-    default_string = models.Job.Priority.get_string(default_priority)
-    result['default_priority'] = default_string
+    result['priorities'] = priorities.Priority.choices()
+    default_priority = priorities.Priority.DEFAULT
+    result['default_priority'] = 'Default'
+    result['max_schedulable_priority'] = priorities.Priority.DEFAULT
     result['users'] = get_users(sort_by=['login'])
     result['labels'] = get_labels(sort_by=['-platform', 'name'])
     result['atomic_groups'] = get_atomic_groups(sort_by=['name'])