Move prefer local devserver check
BUG=chromium:672348
TEST=None
Change-Id: I12725fbee9118a7d6ed19dd5b6f0fdbfa0e94cda
Reviewed-on: https://chromium-review.googlesource.com/418250
Commit-Ready: Allen Li <ayatane@chromium.org>
Tested-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Allen Li <ayatane@chromium.org>
diff --git a/frontend/afe/rpc_utils.py b/frontend/afe/rpc_utils.py
index 3ff81cd..58fa4fb 100644
--- a/frontend/afe/rpc_utils.py
+++ b/frontend/afe/rpc_utils.py
@@ -19,6 +19,7 @@
from autotest_lib.client.common_lib import control_data, error
from autotest_lib.client.common_lib import global_config, priorities
from autotest_lib.client.common_lib import time_utils
+from autotest_lib.client.common_lib.cros import dev_server
# TODO(akeshet): Replace with monarch once we know how to instrument rpc server
# with ts_mon.
from autotest_lib.client.common_lib.cros.graphite import autotest_stats
@@ -1361,7 +1362,7 @@
@return: Name of a dut with the given board and pool.
"""
- if not board or not pool:
+ if not (dev_server.PREFER_LOCAL_DEVSERVER and pool and board):
return None
hosts = get_host_query(
diff --git a/frontend/afe/site_rpc_interface.py b/frontend/afe/site_rpc_interface.py
index 7092ad8..33281a3 100644
--- a/frontend/afe/site_rpc_interface.py
+++ b/frontend/afe/site_rpc_interface.py
@@ -242,14 +242,7 @@
test_source_build = Suite.get_test_source_build(
builds, test_source_build=test_source_build)
- # If 'prefer_local_devserver' is True in global setting, and both board
- # and pool are specified, pick a dut in the given board and pool, and
- # use that to help to pick a devserver in the same subnet of the duts
- # to be used to run tests.
- if dev_server.PREFER_LOCAL_DEVSERVER and pool and board:
- sample_dut = rpc_utils.get_sample_dut(board, pool)
- else:
- sample_dut = None
+ sample_dut = rpc_utils.get_sample_dut(board, pool)
suite_name = canonicalize_suite_name(name)
if run_prod_code: