- cache_filename = md5.hexdigest()
- cache_filepath = os.path.join(
- arv_cmd.make_home_conf_dir(self.CACHE_DIR, 0o700, 'raise'),
- cache_filename)
- return cache_filepath
+ cache_path = Path(self.CACHE_DIR)
+ if len(cache_path.parts) == 1:
+ cache_path = arvados.util._BaseDirectories('CACHE').storage_path(cache_path)
+ else:
+ # Note this is a noop if cache_path is absolute, which is what we want.
+ cache_path = Path.home() / cache_path
+ cache_path.mkdir(parents=True, exist_ok=True, mode=0o700)
+ return str(cache_path / md5.hexdigest())