[autotest] Support using *-LATEST builds for single job runs.
We support build names like peppy-release/LATEST for suites but not
single jobs from the AFE. This CL introduces this support for single
job runs.
BUG=chromium:431060
TEST=moblab.
DEPLOY=apache
Change-Id: I86ce34a79508d34bacbcfa4de655f13d1f14648c
Reviewed-on: https://chromium-review.googlesource.com/316683
Commit-Ready: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
diff --git a/frontend/afe/rpc_interface.py b/frontend/afe/rpc_interface.py
index cb8a8ed..5075642 100644
--- a/frontend/afe/rpc_interface.py
+++ b/frontend/afe/rpc_interface.py
@@ -37,6 +37,7 @@
from django.db.models import Count
import common
from autotest_lib.client.common_lib import priorities
+from autotest_lib.client.common_lib.cros import dev_server
from autotest_lib.client.common_lib.cros.graphite import autotest_stats
from autotest_lib.frontend.afe import control_file, rpc_utils
from autotest_lib.frontend.afe import models, model_logic, model_attributes
@@ -916,6 +917,10 @@
return rpc_utils.create_job_common(
**rpc_utils.get_create_job_common_args(locals()))
+ # Translate the image name, in case its a relative build name.
+ ds = dev_server.ImageServer.resolve(image)
+ image = ds.translate(image)
+
# When image is supplied use a known parameterized test already in the
# database to pass the OS image path from the front end, through the
# scheduler, and finally to autoserv as the --image parameter.