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 | |
7 | 6 |
8 from recipe_engine import recipe_api | 7 from recipe_engine import recipe_api |
9 | 8 |
10 | 9 |
11 # Inherit from RecipeApiPlain because the only thing which is a step is | 10 # Inherit from RecipeApiPlain because the only thing which is a step is |
12 # run_from_dict() | 11 # run_from_dict() |
13 class StepApi(recipe_api.RecipeApiPlain): | 12 class StepApi(recipe_api.RecipeApiPlain): |
14 | 13 |
15 step_client = recipe_api.RequireClient('step') | 14 step_client = recipe_api.RequireClient('step') |
16 | 15 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 kwargs['base_name'] = name | 224 kwargs['base_name'] = name |
226 | 225 |
227 schema = self.make_config() | 226 schema = self.make_config() |
228 schema.set_val(kwargs) | 227 schema.set_val(kwargs) |
229 return self.run_from_dict(schema.as_jsonish()) | 228 return self.run_from_dict(schema.as_jsonish()) |
230 | 229 |
231 # TODO(martiniss) delete, and make generator_script use **kwargs on step() | 230 # TODO(martiniss) delete, and make generator_script use **kwargs on step() |
232 @recipe_api.composite_step | 231 @recipe_api.composite_step |
233 def run_from_dict(self, dct): | 232 def run_from_dict(self, dct): |
234 return self.step_client.run_step(dct) | 233 return self.step_client.run_step(dct) |
OLD | NEW |