Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Unified Diff: recipe_modules/path/api.py

Issue 1906323003: recipe engine: extract infra-specific paths out of the engine (Closed) Base URL: https://github.com/luci/recipes-py.git@master
Patch Set: tmp Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « recipe_modules/path/__init__.py ('k') | recipe_modules/path/config.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/path/api.py
diff --git a/recipe_modules/path/api.py b/recipe_modules/path/api.py
index fb45a7d80b764256b62569edd56914fc4e6eea05..403db192da617e4a314d9ab32607af0def10fc2f 100644
--- a/recipe_modules/path/api.py
+++ b/recipe_modules/path/api.py
@@ -149,7 +149,6 @@ class PathApi(recipe_api.RecipeApi):
def get_config_defaults(self):
return {
- 'PLATFORM': self.m.platform.name,
'CURRENT_WORKING_DIR': self._startup_cwd,
'TEMP_DIR': self._temp_dir,
}
@@ -180,12 +179,7 @@ class PathApi(recipe_api.RecipeApi):
if self._config_set:
return
self._config_set = True
-
- path_config = self.m.properties.get('path_config')
- if path_config in ('kitchen', 'swarming'):
- self.set_config(path_config)
- else:
- self.set_config('buildbot')
+ self.set_config('BASE')
def mock_add_paths(self, path):
"""For testing purposes, assert that |path| exists."""
@@ -200,15 +194,15 @@ class PathApi(recipe_api.RecipeApi):
self._lazy_set_config()
if not self._test_data.enabled: # pragma: no cover
# New path as str.
- new_path = tempfile.mkdtemp(prefix=prefix, dir=str(self['tmp_base']))
+ new_path = tempfile.mkdtemp(prefix=prefix, dir=str(self['tmp']))
# Ensure it's under self._temp_dir, convert to Path.
new_path = _split_path(new_path)
assert new_path[:len(self._temp_dir)] == self._temp_dir
- temp_dir = self['tmp_base'].join(*new_path[len(self._temp_dir):])
+ temp_dir = self['tmp'].join(*new_path[len(self._temp_dir):])
else:
self._test_counter += 1
assert isinstance(prefix, basestring)
- temp_dir = self['tmp_base'].join(
+ temp_dir = self['tmp'].join(
'%s_tmp_%d' % (prefix, self._test_counter))
self.mock_add_paths(temp_dir)
return temp_dir
« no previous file with comments | « recipe_modules/path/__init__.py ('k') | recipe_modules/path/config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698