aboutsummaryrefslogtreecommitdiff
path: root/crosperf/experiment_factory.py
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 /crosperf/experiment_factory.py
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 'crosperf/experiment_factory.py')
-rw-r--r--crosperf/experiment_factory.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/crosperf/experiment_factory.py b/crosperf/experiment_factory.py
index 563f3ac6..5b4d4b0d 100644
--- a/crosperf/experiment_factory.py
+++ b/crosperf/experiment_factory.py
@@ -143,14 +143,20 @@ class ExperimentFactory(object):
config.AddConfig('no_email', global_settings.GetField('no_email'))
share_cache = global_settings.GetField('share_cache')
results_dir = global_settings.GetField('results_dir')
+ # Warn user that option use_file_locks is deprecated.
use_file_locks = global_settings.GetField('use_file_locks')
+ if use_file_locks:
+ l = logger.GetLogger()
+ l.LogWarning('Option use_file_locks is deprecated, please remove it '
+ 'from your experiment settings.')
locks_dir = global_settings.GetField('locks_dir')
- # If we pass a blank locks_dir to the Experiment, it will use the AFE server
- # lock mechanism. So if the user specified use_file_locks, but did not
- # specify a locks dir, set the locks dir to the default locks dir in
+ # If not specified, set the locks dir to the default locks dir in
# file_lock_machine.
- if use_file_locks and not locks_dir:
+ if not locks_dir:
locks_dir = file_lock_machine.Machine.LOCKS_DIR
+ if not os.path.exists(locks_dir):
+ raise RuntimeError('Cannot access default lock directory. '
+ 'Please run prodaccess or specify a local directory')
chrome_src = global_settings.GetField('chrome_src')
show_all_results = global_settings.GetField('show_all_results')
cwp_dso = global_settings.GetField('cwp_dso')