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

Unified Diff: recipe_modules/step/api.py

Issue 2663943002: Enforce passing cwd via context rather then api.step kwargs (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/step/api.py
diff --git a/recipe_modules/step/api.py b/recipe_modules/step/api.py
index 8530f6ffdafcd8d71d8595732653e2a08a79fa7c..0620453cc50d86ac054cd0fe1de87d0c59323fc8 100644
--- a/recipe_modules/step/api.py
+++ b/recipe_modules/step/api.py
@@ -77,6 +77,9 @@ class StepApi(recipe_api.RecipeApiPlain):
""" See recipe_api.py for docs. """
return recipe_api.context
+ def get_context(self):
+ return recipe_api._STEP_CONTEXT
+
@contextlib.contextmanager
def nest(self, name):
"""Nest is the high-level interface to annotated hierarchical steps.
@@ -101,7 +104,7 @@ class StepApi(recipe_api.RecipeApiPlain):
return recipe_api.defer_results
def __call__(self, name, cmd, ok_ret=None, infra_step=False, wrapper=(),
- timeout=None, cwd=None, env=None, allow_subannotations=None,
+ timeout=None, env=None, allow_subannotations=None,
trigger_specs=None, stdout=None, stderr=None, stdin=None,
step_test_data=None):
"""Returns a step dictionary which is compatible with annotator.py.
@@ -141,8 +144,6 @@ class StepApi(recipe_api.RecipeApiPlain):
Opaque step object produced and understood by recipe engine.
"""
kwargs = {}
- if cwd:
- kwargs['cwd'] = cwd
if env:
kwargs['env'] = env
if allow_subannotations is not None:
@@ -172,7 +173,7 @@ class StepApi(recipe_api.RecipeApiPlain):
kwargs['ok_ret'] = ok_ret
# Obtain information from composite step parent.
- compositor = recipe_api._STEP_CONTEXT
+ compositor = self.get_context()
# Calculate our full step name. If a step already has that name, add an
# index to the end of it.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698