OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 """Recipe module to ensure a checkout is consistant on a bot.""" | 6 """Recipe module to ensure a checkout is consistant on a bot.""" |
7 | 7 |
8 from recipe_engine import recipe_api | 8 from recipe_engine import recipe_api |
9 | 9 |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 super(BotUpdateApi, self).__init__(*args, **kwargs) | 27 super(BotUpdateApi, self).__init__(*args, **kwargs) |
28 | 28 |
29 def __call__(self, name, cmd, **kwargs): | 29 def __call__(self, name, cmd, **kwargs): |
30 """Wrapper for easy calling of bot_update.""" | 30 """Wrapper for easy calling of bot_update.""" |
31 assert isinstance(cmd, (list, tuple)) | 31 assert isinstance(cmd, (list, tuple)) |
32 bot_update_path = self.resource('bot_update.py') | 32 bot_update_path = self.resource('bot_update.py') |
33 kwargs.setdefault('infra_step', True) | 33 kwargs.setdefault('infra_step', True) |
34 kwargs.setdefault('env', {}) | 34 kwargs.setdefault('env', {}) |
35 kwargs['env'].setdefault('PATH', '%(PATH)s') | 35 kwargs['env'].setdefault('PATH', '%(PATH)s') |
36 kwargs['env']['PATH'] = self.m.path.pathsep.join([ | 36 kwargs['env']['PATH'] = self.m.path.pathsep.join([ |
37 str(self._module.PACKAGE_REPO_ROOT), kwargs['env']['PATH']]) | 37 kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)]) |
38 return self.m.python(name, bot_update_path, cmd, **kwargs) | 38 return self.m.python(name, bot_update_path, cmd, **kwargs) |
39 | 39 |
40 @property | 40 @property |
41 def last_returned_properties(self): | 41 def last_returned_properties(self): |
42 return self._last_returned_properties | 42 return self._last_returned_properties |
43 | 43 |
44 # DO NOT USE. | 44 # DO NOT USE. |
45 # The below method will be removed after there are no more callers of | 45 # The below method will be removed after there are no more callers of |
46 # tryserver.maybe_apply_issue (skbug.com/5588). | 46 # tryserver.maybe_apply_issue (skbug.com/5588). |
47 def apply_gerrit_ref(self, root, gerrit_no_reset=False, | 47 def apply_gerrit_ref(self, root, gerrit_no_reset=False, |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 283 |
284 # bot_update actually just sets root to be the folder name of the | 284 # bot_update actually just sets root to be the folder name of the |
285 # first solution. | 285 # first solution. |
286 if step_result.json.output['did_run']: | 286 if step_result.json.output['did_run']: |
287 co_root = step_result.json.output['root'] | 287 co_root = step_result.json.output['root'] |
288 cwd = kwargs.get('cwd', self.m.path['slave_build']) | 288 cwd = kwargs.get('cwd', self.m.path['slave_build']) |
289 if 'checkout' not in self.m.path: | 289 if 'checkout' not in self.m.path: |
290 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) | 290 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) |
291 | 291 |
292 return step_result | 292 return step_result |
OLD | NEW |