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

Unified Diff: recipe_engine/step_runner.py

Issue 2885293003: [step_runner] do not immediately bail when START_DIR is gone. (Closed)
Patch Set: whitespace Created 3 years, 7 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 | recipes/engine_tests/missing_start_dir.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/step_runner.py
diff --git a/recipe_engine/step_runner.py b/recipe_engine/step_runner.py
index 7f81fccb0fcec27446de16dea3fc824a644b6213..f9d2c592a2b055b3904f94db7abc365e1af4a763 100644
--- a/recipe_engine/step_runner.py
+++ b/recipe_engine/step_runner.py
@@ -284,7 +284,15 @@ class SubprocessStepRunner(StepRunner):
"""
def gen_step_prelude():
yield ' '.join(map(_shell_quote, step.config.cmd))
- yield 'in dir %s:' % (step.config.cwd or os.getcwd())
+ cwd = step.config.cwd
+ if cwd is None:
+ try:
+ cwd = os.getcwd()
+ except OSError as ex:
+ cwd = '??? (ENGINE START_DIR IS MISSING: %r)' % (ex,)
+ elif not os.path.isdir(cwd):
+ cwd += ' (ENGINE START_DIR IS MISSING OR NOT A DIR)'
+ yield 'in dir %s:' % (cwd,)
for key, value in sorted(step.config._asdict().items()):
if value is not None:
yield ' %s: %s' % (key, self._render_step_value(value))
« no previous file with comments | « no previous file | recipes/engine_tests/missing_start_dir.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698