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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 # The gerrit_ref and gerrit_repo must be together or not at all. If one is | 115 # The gerrit_ref and gerrit_repo must be together or not at all. If one is |
116 # missing, clear both of them. | 116 # missing, clear both of them. |
117 if not gerrit_ref or not gerrit_repo: | 117 if not gerrit_ref or not gerrit_repo: |
118 gerrit_repo = gerrit_ref = None | 118 gerrit_repo = gerrit_ref = None |
119 assert (gerrit_ref != None) == (gerrit_repo != None) | 119 assert (gerrit_ref != None) == (gerrit_repo != None) |
120 | 120 |
121 # Point to the oauth2 auth files if specified. | 121 # Point to the oauth2 auth files if specified. |
122 # These paths are where the bots put their credential files. | 122 # These paths are where the bots put their credential files. |
123 if patch_oauth2: | 123 if patch_oauth2: |
124 email_file = self.m.path['build'].join( | 124 email_file = self.m.infra_paths['build'].join( |
125 'site_config', '.rietveld_client_email') | 125 'site_config', '.rietveld_client_email') |
126 key_file = self.m.path['build'].join( | 126 key_file = self.m.infra_paths['build'].join( |
127 'site_config', '.rietveld_secret_key') | 127 'site_config', '.rietveld_secret_key') |
128 else: | 128 else: |
129 email_file = key_file = None | 129 email_file = key_file = None |
130 | 130 |
131 rev_map = cfg.got_revision_mapping.as_jsonish() | 131 rev_map = cfg.got_revision_mapping.as_jsonish() |
132 | 132 |
133 flags = [ | 133 flags = [ |
134 # 1. Do we want to run? (master/builder/slave). | 134 # 1. Do we want to run? (master/builder/slave). |
135 ['--master', master], | 135 ['--master', master], |
136 ['--builder', builder], | 136 ['--builder', builder], |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 else: | 265 else: |
266 # This is actual patch failure. | 266 # This is actual patch failure. |
267 self.m.tryserver.set_patch_failure_tryjob_result() | 267 self.m.tryserver.set_patch_failure_tryjob_result() |
268 self.m.python.failing_step( | 268 self.m.python.failing_step( |
269 'Patch failure', 'Check the bot_update step for details') | 269 'Patch failure', 'Check the bot_update step for details') |
270 | 270 |
271 # bot_update actually just sets root to be the folder name of the | 271 # bot_update actually just sets root to be the folder name of the |
272 # first solution. | 272 # first solution. |
273 if step_result.json.output['did_run']: | 273 if step_result.json.output['did_run']: |
274 co_root = step_result.json.output['root'] | 274 co_root = step_result.json.output['root'] |
275 cwd = kwargs.get('cwd', self.m.path['slave_build']) | 275 cwd = kwargs.get('cwd', self.m.infra_paths['slave_build']) |
276 if 'checkout' not in self.m.path: | 276 if 'checkout' not in self.m.path: |
277 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) | 277 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) |
278 | 278 |
279 return step_result | 279 return step_result |
OLD | NEW |