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

Unified Diff: recipe_modules/path/api.py

Issue 1923013002: Revert of recipe engine: extract infra-specific paths out of the engine (Closed) Base URL: https://github.com/luci/recipes-py.git@master
Patch Set: 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 403db192da617e4a314d9ab32607af0def10fc2f..fb45a7d80b764256b62569edd56914fc4e6eea05 100644
--- a/recipe_modules/path/api.py
+++ b/recipe_modules/path/api.py
@@ -149,6 +149,7 @@
def get_config_defaults(self):
return {
+ 'PLATFORM': self.m.platform.name,
'CURRENT_WORKING_DIR': self._startup_cwd,
'TEMP_DIR': self._temp_dir,
}
@@ -179,7 +180,12 @@
if self._config_set:
return
self._config_set = True
- self.set_config('BASE')
+
+ path_config = self.m.properties.get('path_config')
+ if path_config in ('kitchen', 'swarming'):
+ self.set_config(path_config)
+ else:
+ self.set_config('buildbot')
def mock_add_paths(self, path):
"""For testing purposes, assert that |path| exists."""
@@ -194,15 +200,15 @@
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']))
+ new_path = tempfile.mkdtemp(prefix=prefix, dir=str(self['tmp_base']))
# 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'].join(*new_path[len(self._temp_dir):])
+ temp_dir = self['tmp_base'].join(*new_path[len(self._temp_dir):])
else:
self._test_counter += 1
assert isinstance(prefix, basestring)
- temp_dir = self['tmp'].join(
+ temp_dir = self['tmp_base'].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