| OLD | NEW |
| 1 # Copyright 2013 The LUCI Authors. All rights reserved. | 1 # Copyright 2013 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed under the Apache License, Version 2.0 | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # that can be found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import contextlib | 5 import contextlib |
| 6 import datetime | 6 import datetime |
| 7 | 7 |
| 8 from recipe_engine import recipe_api | 8 from recipe_engine import recipe_api |
| 9 | 9 |
| 10 | 10 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 name = "%s (%d)" % (name, step_count) | 154 name = "%s (%d)" % (name, step_count) |
| 155 self._seen_steps.add(full_name) | 155 self._seen_steps.add(full_name) |
| 156 | 156 |
| 157 if 'cwd' not in kwargs: | 157 if 'cwd' not in kwargs: |
| 158 kwargs['cwd'] = compositor.get('cwd') | 158 kwargs['cwd'] = compositor.get('cwd') |
| 159 kwargs['env'] = compositor.get_with_context('env', kwargs.get('env', {})) | 159 kwargs['env'] = compositor.get_with_context('env', kwargs.get('env', {})) |
| 160 kwargs['infra_step'] = compositor.get_with_context( | 160 kwargs['infra_step'] = compositor.get_with_context( |
| 161 'infra_step', bool(infra_step)) | 161 'infra_step', bool(infra_step)) |
| 162 kwargs['step_nest_level'] = compositor.get_with_context('nest_level', 0) | 162 kwargs['step_nest_level'] = compositor.get_with_context('nest_level', 0) |
| 163 kwargs['name'] = full_name | 163 kwargs['name'] = full_name |
| 164 kwargs['base_name'] = name |
| 164 | 165 |
| 165 schema = self.make_config() | 166 schema = self.make_config() |
| 166 schema.set_val(kwargs) | 167 schema.set_val(kwargs) |
| 167 return self.run_from_dict(schema.as_jsonish()) | 168 return self.run_from_dict(schema.as_jsonish()) |
| 168 | 169 |
| 169 # TODO(martiniss) delete, and make generator_script use **kwargs on step() | 170 # TODO(martiniss) delete, and make generator_script use **kwargs on step() |
| 170 @recipe_api.composite_step | 171 @recipe_api.composite_step |
| 171 def run_from_dict(self, dct): | 172 def run_from_dict(self, dct): |
| 172 return self._engine.run_step(dct) | 173 return self._engine.run_step(dct) |
| OLD | NEW |