aboutsummaryrefslogtreecommitdiff
path: root/cros_utils
diff options
context:
space:
mode:
authorZhizhou Yang <zhizhouy@google.com>2019-09-24 10:32:00 -0700
committerZhizhou Yang <zhizhouy@google.com>2019-09-27 21:47:17 +0000
commit4713fd1d6e502969ab8690adb513d8d00973ac44 (patch)
treeb8a350ac4691ba8184072885c23dcf6f40acd020 /cros_utils
parent1125ad815d06eb960681154be9fc2688af5470c7 (diff)
downloadtoolchain-utils-4713fd1d6e502969ab8690adb513d8d00973ac44.tar.gz
toolchain-utils: remove AFE local server code
We used to have local server for AFE locking mechanism to lock non-lab machines. But this local server was not supported since long time ago. This patch removes all local server related code from AFE locking. Note that there will be another CLs to deal with issues in http://crbug.com/1006434#c1 TEST=Passed crosperf local tests with different type of machines. BUG=chromium:1006434 Change-Id: I47dbca73edd3e493496fd13ba0b3de705dc11513 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1822029 Reviewed-by: Caroline Tice <cmtice@chromium.org> Commit-Queue: Zhizhou Yang <zhizhouy@google.com> Tested-by: Zhizhou Yang <zhizhouy@google.com>
Diffstat (limited to 'cros_utils')
-rw-r--r--cros_utils/locks.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/cros_utils/locks.py b/cros_utils/locks.py
index cb96368e..07434145 100644
--- a/cros_utils/locks.py
+++ b/cros_utils/locks.py
@@ -1,4 +1,9 @@
-# Copyright 2015 The Chromium OS Authors. All rights reserved.
+# -*- coding: utf-8 -*-
+#
+# Copyright 2019 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
"""Utilities for locking machines."""
from __future__ import print_function
@@ -17,8 +22,8 @@ def AcquireLock(machines, chromeos_root, timeout=1200):
sleep_time = min(10, timeout / 10.0)
while True:
try:
- afe_lock_machine.AFELockManager(machines, False, chromeos_root,
- None).UpdateMachines(True)
+ afe_lock_machine.AFELockManager(machines, False,
+ chromeos_root).UpdateMachines(True)
break
except Exception as e:
if time.time() - start_time > timeout:
@@ -35,10 +40,10 @@ def ReleaseLock(machines, chromeos_root):
"""Release locked machine(s), using AFE server for locking."""
unlocked = True
try:
- afe_lock_machine.AFELockManager(machines, False, chromeos_root,
- None).UpdateMachines(False)
+ afe_lock_machine.AFELockManager(machines, False,
+ chromeos_root).UpdateMachines(False)
except Exception as e:
unlocked = False
- logger.GetLogger().LogWarning('Could not unlock %s. %s' %
- (repr(machines), str(e)))
+ logger.GetLogger().LogWarning(
+ 'Could not unlock %s. %s' % (repr(machines), str(e)))
return unlocked