aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/recipe_modules/run
diff options
context:
space:
mode:
authorGravatar Eric Boren <borenet@google.com>2017-03-21 08:20:33 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-21 12:51:40 +0000
commitbbb24f2ab83e4799ad392be3e49168425c6555b0 (patch)
tree7ebd09fd2e1e6d45bd10193b5e369df86ae8e576 /infra/bots/recipe_modules/run
parent89150582643f1ef4893a0cdeaadf5886e5cde76d (diff)
Followup fixes for recipe roll
Simplifying some environment madness. Nobody gets to modify default_env. Always apply it in run.__call__(). Add depot_tools path to PATH in default_env. Result is simpler but now default_env is applied in many more places, which should be harmless. BUG=skia: Change-Id: I8299d50bde2bc3e2d47568a267d1d962a3fc3d56 Reviewed-on: https://skia-review.googlesource.com/9916 Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Eric Boren <borenet@google.com>
Diffstat (limited to 'infra/bots/recipe_modules/run')
-rw-r--r--infra/bots/recipe_modules/run/api.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/infra/bots/recipe_modules/run/api.py b/infra/bots/recipe_modules/run/api.py
index 61f4f0742b..e4e0ae8851 100644
--- a/infra/bots/recipe_modules/run/api.py
+++ b/infra/bots/recipe_modules/run/api.py
@@ -68,7 +68,7 @@ class SkiaStepApi(recipe_api.RecipeApi):
def rmtree(self, path):
"""Wrapper around api.file.rmtree with environment fix."""
- env = self.m.step.get_from_context('env') or {}
+ env = self.m.step.get_from_context('env', {})
env['PYTHONPATH'] = str(self.m.path['start_dir'].join(
'skia', 'infra', 'bots', '.recipe_deps', 'build', 'scripts'))
with self.m.step.context({'env': env}):
@@ -79,10 +79,11 @@ class SkiaStepApi(recipe_api.RecipeApi):
def __call__(self, steptype, name, abort_on_failure=True,
fail_build_on_failure=True, **kwargs):
"""Run a step. If it fails, keep going but mark the build status failed."""
- env = self.m.step.get_from_context('env') or {}
+ env = self.m.step.get_from_context('env', {})
env.update(self.m.vars.default_env)
try:
- return steptype(name=name, **kwargs)
+ with self.m.step.context({'env': env}):
+ return steptype(name=name, **kwargs)
except self.m.step.StepFailure as e:
if abort_on_failure or fail_build_on_failure:
self._failed.append(e)