aboutsummaryrefslogtreecommitdiff
path: root/afe_lock_machine.py
diff options
context:
space:
mode:
authorHan Shen <shenhan@google.com>2015-06-11 13:56:08 -0700
committerHan Shen <shenhan@google.com>2015-06-11 14:16:04 -0700
commit441c94998a0b1b547bd9b4e594acb05d9e5ed6eb (patch)
treee354f7e706bf8ed2417fea31e1e4f3d5d583fc67 /afe_lock_machine.py
parente5bc63bbed4e001b080c4ce0b18c5c78900d4786 (diff)
downloadtoolchain-utils-441c94998a0b1b547bd9b4e594acb05d9e5ed6eb.tar.gz
Correctly calculate the machines_file path.
Rahul and I were having problems running crosperf outside crosperf directory, the problematic we got was here - ./afe_lock_machine.py:181: machines_file = os.path.join(os.getcwd(), 'crosperf', 'default_remotes') This assumes that crosperf is invoked right under toolchain-utils, which is, as likely as not, false.
Diffstat (limited to 'afe_lock_machine.py')
-rwxr-xr-xafe_lock_machine.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/afe_lock_machine.py b/afe_lock_machine.py
index bb4eb725..128ee8ed 100755
--- a/afe_lock_machine.py
+++ b/afe_lock_machine.py
@@ -178,7 +178,8 @@ class AFELockManager(object):
Returns:
A list of names of the toolchain machines in the ChromeOS HW lab.
"""
- machines_file = os.path.join(os.getcwd(), 'crosperf', 'default_remotes')
+ machines_file = os.path.join(os.path.dirname(__file__),
+ 'crosperf', 'default_remotes')
machine_list = []
with open(machines_file, 'r') as input_file:
lines = input_file.readlines()