| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The LUCI Authors. All rights reserved. | 2 # Copyright 2015 The LUCI Authors. All rights reserved. |
| 3 # Use of this source code is governed under the Apache License, Version 2.0 | 3 # Use of this source code is governed under the Apache License, Version 2.0 |
| 4 # that can be found in the LICENSE file. | 4 # that can be found in the LICENSE file. |
| 5 | 5 |
| 6 """Tool to interact with recipe repositories. | 6 """Tool to interact with recipe repositories. |
| 7 | 7 |
| 8 This tool operates on the nearest ancestor directory containing an | 8 This tool operates on the nearest ancestor directory containing an |
| 9 infra/config/recipes.cfg. | 9 infra/config/recipes.cfg. |
| 10 """ | 10 """ |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 with stream_engine.make_step_stream('Step Timed Out') as s: | 128 with stream_engine.make_step_stream('Step Timed Out') as s: |
| 129 with s.new_log_stream('timeout_s') as l: | 129 with s.new_log_stream('timeout_s') as l: |
| 130 l.write_line(f.timeout.timeout_s) | 130 l.write_line(f.timeout.timeout_s) |
| 131 elif f.HasField('step_data'): | 131 elif f.HasField('step_data'): |
| 132 with stream_engine.make_step_stream('Invalid Step Data Access') as s: | 132 with stream_engine.make_step_stream('Invalid Step Data Access') as s: |
| 133 with s.new_log_stream('step') as l: | 133 with s.new_log_stream('step') as l: |
| 134 l.write_line(f.step_data.step) | 134 l.write_line(f.step_data.step) |
| 135 | 135 |
| 136 with stream_engine.make_step_stream('Failure reason') as s: | 136 with stream_engine.make_step_stream('Failure reason') as s: |
| 137 with s.new_log_stream('reason') as l: | 137 with s.new_log_stream('reason') as l: |
| 138 l.write_line(f.human_reason) | 138 l.write_split(f.human_reason) |
| 139 | 139 |
| 140 return 1 | 140 return 1 |
| 141 | 141 |
| 142 return 0 | 142 return 0 |
| 143 | 143 |
| 144 | 144 |
| 145 def run(package_deps, args, op_args): | 145 def run(package_deps, args, op_args): |
| 146 from recipe_engine import run as recipe_run | 146 from recipe_engine import run as recipe_run |
| 147 from recipe_engine import loader | 147 from recipe_engine import loader |
| 148 from recipe_engine import step_runner | 148 from recipe_engine import step_runner |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 | 709 |
| 710 if not isinstance(ret, int): | 710 if not isinstance(ret, int): |
| 711 if ret is None: | 711 if ret is None: |
| 712 ret = 0 | 712 ret = 0 |
| 713 else: | 713 else: |
| 714 print >> sys.stderr, ret | 714 print >> sys.stderr, ret |
| 715 ret = 1 | 715 ret = 1 |
| 716 sys.stdout.flush() | 716 sys.stdout.flush() |
| 717 sys.stderr.flush() | 717 sys.stderr.flush() |
| 718 os._exit(ret) | 718 os._exit(ret) |
| OLD | NEW |