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

Unified Diff: recipe_engine/run.py

Issue 2934583003: [step] Remove config indirection. (Closed)
Patch Set: comments Created 3 years, 6 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_engine/recipe_api.py ('k') | recipe_engine/step_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/run.py
diff --git a/recipe_engine/run.py b/recipe_engine/run.py
index 074c90a8c36b10544492730ef1adb9cc7d2f0173..96e4253604c9377203b7f154e46f36fc3b924757 100644
--- a/recipe_engine/run.py
+++ b/recipe_engine/run.py
@@ -250,7 +250,8 @@ class RecipeEngine(object):
Runs a step.
Args:
- step_config (recipe_api.StepConfig): The step configuration to run.
+ step_config (recipe_api.StepClient.StepConfig): The step configuration to
+ run.
Returns:
A StepData object containing the result of running the step.
@@ -274,20 +275,20 @@ class RecipeEngine(object):
if step_result.retcode in step_config.ok_ret:
step_result.presentation.status = 'SUCCESS'
return step_result
+
+ if not step_config.infra_step:
+ state = 'FAILURE'
+ exc = recipe_api.StepFailure
else:
- if not step_config.infra_step:
- state = 'FAILURE'
- exc = recipe_api.StepFailure
- else:
- state = 'EXCEPTION'
- exc = recipe_api.InfraFailure
+ state = 'EXCEPTION'
+ exc = recipe_api.InfraFailure
- step_result.presentation.status = state
+ step_result.presentation.status = state
- self._step_stack[-1].open_step.stream.write_line(
- 'step returned non-zero exit code: %d' % step_result.retcode)
+ self._step_stack[-1].open_step.stream.write_line(
+ 'step returned non-zero exit code: %d' % step_result.retcode)
- raise exc(step_config.name, step_result)
+ raise exc(step_config.name, step_result)
def run(self, recipe_script, api, properties):
"""Run a recipe represented by a recipe_script object.
« no previous file with comments | « recipe_engine/recipe_api.py ('k') | recipe_engine/step_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698