aboutsummaryrefslogtreecommitdiff
path: root/cros_utils
diff options
context:
space:
mode:
authorZhizhou Yang <zhizhouy@google.com>2019-10-14 17:36:09 -0700
committerZhizhou Yang <zhizhouy@google.com>2019-10-15 22:48:08 +0000
commitbf7ee87429d2c9730349ebc22f904b5a3fac7107 (patch)
treeafe85d6bc0535e2d376f6d9be615beffdaed223c /cros_utils
parentea5fbd9e6c99d18e002cec6e86bfb889d0820370 (diff)
downloadtoolchain-utils-bf7ee87429d2c9730349ebc22f904b5a3fac7107.tar.gz
toolchain-utils: change naming related to AFE lock
After introducing the new locking mechanism, the behavior of AFELockManager totally changed. This file changed the naming of all related code in toochain-utils. This patch also changed the behavior of locks_dir option, deprecated the use_file_lock option explicitly. TEST=Tested with different DUT types. BUG=chromium:1006434 Change-Id: Ib15efce54ec4d4c5c2a18fecca3f350248462035 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1863530 Reviewed-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Denis Nikitin <denik@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.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/cros_utils/locks.py b/cros_utils/locks.py
index 07434145..4ecbe0a9 100644
--- a/cros_utils/locks.py
+++ b/cros_utils/locks.py
@@ -10,20 +10,20 @@ from __future__ import print_function
import time
-import afe_lock_machine
+import lock_machine
import logger
def AcquireLock(machines, chromeos_root, timeout=1200):
- """Acquire lock for machine(s) with timeout, using AFE server for locking."""
+ """Acquire lock for machine(s) with timeout."""
start_time = time.time()
locked = True
sleep_time = min(10, timeout / 10.0)
while True:
try:
- afe_lock_machine.AFELockManager(machines, False,
- chromeos_root).UpdateMachines(True)
+ lock_machine.LockManager(machines, False,
+ chromeos_root).UpdateMachines(True)
break
except Exception as e:
if time.time() - start_time > timeout:
@@ -37,11 +37,11 @@ def AcquireLock(machines, chromeos_root, timeout=1200):
def ReleaseLock(machines, chromeos_root):
- """Release locked machine(s), using AFE server for locking."""
+ """Release locked machine(s)."""
unlocked = True
try:
- afe_lock_machine.AFELockManager(machines, False,
- chromeos_root).UpdateMachines(False)
+ lock_machine.LockManager(machines, False,
+ chromeos_root).UpdateMachines(False)
except Exception as e:
unlocked = False
logger.GetLogger().LogWarning(