Index: recipe_engine/run.py |
diff --git a/recipe_engine/run.py b/recipe_engine/run.py |
index c6d98ce5cc025603658c10dd003bd8dc53991d0f..8878152176499e68f32dff9e53b2094ee9c72dc5 100644 |
--- a/recipe_engine/run.py |
+++ b/recipe_engine/run.py |
@@ -156,7 +156,6 @@ |
s.set_step_status('EXCEPTION') |
if engine_flags and engine_flags.use_result_proto: |
return result_pb2.Result( |
- recipe_package=universe_view.universe.config_file.read(), |
failure=result_pb2.Failure( |
human_reason=str(e), |
exception=result_pb2.Exception( |
@@ -309,36 +308,49 @@ |
return self._old_run(recipe_script, api, properties) |
def _new_run(self, recipe_script, api, properties): |
- result = result_pb2.Result( |
- recipe_package=self.universe.config_file.read(), |
- ) |
+ result = None |
with self._step_runner.run_context(): |
try: |
try: |
recipe_result = recipe_script.run(api, properties) |
- result.json_result = json.dumps(recipe_result) |
+ result = result_pb2.Result(json_result=json.dumps(recipe_result)) |
finally: |
self._close_through_level(0) |
except recipe_api.StepFailure as f: |
- result.failure.human_reason = f.reason |
- result.failure.failure.step = f.name |
+ result = result_pb2.Result( |
+ failure=result_pb2.Failure( |
+ human_reason=f.reason, |
+ failure=result_pb2.StepFailure( |
+ step=f.name |
+ ))) |
except types.StepDataAttributeError as ex: |
- result.failure.human_reason = ex.message |
- result.failure.step_data.step = f.name |
+ result = result_pb2.Result( |
+ failure=result_pb2.Failure( |
+ human_reason=ex.message, |
+ step_data=result_pb2.StepData( |
+ step=f.name |
+ ))) |
# Let the step runner run_context decide what to do. |
raise |
except subprocess42.TimeoutExpired as ex: |
- result.failure.human_reason = "Step time out: %r" % ex |
- result.failure.timeout.timeout_s = ex.timeout |
+ result = result_pb2.Result( |
+ failure=result_pb2.Failure( |
+ human_reason="Step time out: %r" % ex, |
+ timeout= result_pb2.Timeout( |
+ timeout_s=ex.timeout |
+ ))) |
except Exception as ex: |
- result.failure.human_reason = "Uncaught Exception: %r" % ex |
- result.failure.exception.traceback[:] = ( |
- traceback.format_exc().splitlines()) |
+ result = result_pb2.Result( |
+ failure=result_pb2.Failure( |
+ human_reason="Uncaught Exception: %r" % ex, |
+ exception=result_pb2.Exception( |
+ traceback=traceback.format_exc().splitlines() |
+ ))) |
# Let the step runner run_context decide what to do. |
raise |