aboutsummaryrefslogtreecommitdiff
path: root/crosperf/results_cache.py
diff options
context:
space:
mode:
authorcmtice <cmtice@google.com>2014-10-16 15:49:56 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-22 21:50:02 +0000
commit1a224369afcbfd0276f4c7bdc625dec7f7b30d01 (patch)
tree4e8e4cfb7a87124eed85535392d9dd552e5b83e2 /crosperf/results_cache.py
parentbf70b0431858abf04d9b894c6d0f060e85589dc5 (diff)
downloadtoolchain-utils-1a224369afcbfd0276f4c7bdc625dec7f7b30d01.tar.gz
Fix issue where crosperf can't find local cros_scratch.
Crosperf was assuming the user always has an NFS home directory, and was looking for the cros_scratch directory there. This makes crosperf use the user's home directory, whether it's NFS or local. Also change --share_users, which also assumed NFS home directories, to --share_cache, which requires specification of the cache path(s) to use. BUG=None TEST=Tested this with my new local homedir. Change-Id: I28d15467dfbd25b8b237cefa2979d3fd9464a7a7 Reviewed-on: https://chrome-internal-review.googlesource.com/179978 Reviewed-by: Yunlian Jiang <yunlian@google.com> Commit-Queue: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'crosperf/results_cache.py')
-rw-r--r--crosperf/results_cache.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/crosperf/results_cache.py b/crosperf/results_cache.py
index efdb405f..de6e572a 100644
--- a/crosperf/results_cache.py
+++ b/crosperf/results_cache.py
@@ -21,8 +21,7 @@ from utils import misc
from image_checksummer import ImageChecksummer
-SCRATCH_BASE = "/home/%s/cros_scratch"
-SCRATCH_DIR = SCRATCH_BASE % getpass.getuser()
+SCRATCH_DIR = os.path.expanduser("~/cros_scratch")
RESULTS_FILE = "results.txt"
MACHINE_FILE = "machine.txt"
AUTOTEST_TARBALL = "autotest.tbz2"
@@ -471,7 +470,7 @@ class ResultsCache(object):
def Init(self, chromeos_image, chromeos_root, test_name, iteration,
test_args, profiler_args, machine_manager, board, cache_conditions,
- logger_to_use, log_level, label, share_users, suite,
+ logger_to_use, log_level, label, share_cache, suite,
show_all_results):
self.chromeos_image = chromeos_image
self.chromeos_root = chromeos_root
@@ -486,7 +485,7 @@ class ResultsCache(object):
self._ce = command_executer.GetCommandExecuter(self._logger,
log_level=log_level)
self.label = label
- self.share_users = share_users
+ self.share_cache = share_cache
self.suite = suite
self.log_level = log_level
self.show_all = show_all_results
@@ -514,10 +513,12 @@ class ResultsCache(object):
else:
cache_path = [os.path.join(SCRATCH_DIR, cache_dir)]
- if len(self.share_users):
- for i in [x.strip() for x in self.share_users.split(",")]:
- path = SCRATCH_BASE % i
- cache_path.append(os.path.join(path, cache_dir))
+ if len(self.share_cache):
+ for path in [x.strip() for x in self.share_cache.split(",")]:
+ if os.path.exists(path):
+ cache_path.append(os.path.join(path, cache_dir))
+ else:
+ self._logger.LogFatal("Unable to find shared cache: %s" % path)
return cache_path