diff options
Diffstat (limited to 'cros_utils')
-rw-r--r-- | cros_utils/locks.py | 19 |
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 |