host_lock_manager: Pass in global AFE instance for autotest shards
BUG=chromium:540060
TEST=ran with trybot image; can successfully lock 'packet_capture'
Change-Id: Ie6197635648b32ff1b9ac2456404d342f0104c24
Reviewed-on: https://chromium-review.googlesource.com/315943
Commit-Ready: Tien Chang <tienchang@chromium.org>
Tested-by: Tien Chang <tienchang@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
diff --git a/server/cros/host_lock_manager.py b/server/cros/host_lock_manager.py
index 0cdded1..2c88c20 100644
--- a/server/cros/host_lock_manager.py
+++ b/server/cros/host_lock_manager.py
@@ -4,8 +4,9 @@
import logging
import signal
-
import common
+
+from autotest_lib.server import site_utils
from autotest_lib.server.cros.dynamic_suite import frontend_wrappers
"""HostLockManager class, for the dynamic_suite module.
@@ -57,9 +58,9 @@
@param afe: an instance of AFE as defined in server/frontend.py.
"""
- self._afe = afe or frontend_wrappers.RetryingAFE(timeout_min=30,
- delay_sec=10,
- debug=False)
+ self._afe = afe or frontend_wrappers.RetryingAFE(
+ timeout_min=30, delay_sec=10, debug=False,
+ server=site_utils.get_global_afe_hostname())
# Keep track of hosts locked by this instance.
self._locked_hosts = set()