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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 # The gerrit_ref and gerrit_repo must be together or not at all. If one is | 113 # The gerrit_ref and gerrit_repo must be together or not at all. If one is |
114 # missing, clear both of them. | 114 # missing, clear both of them. |
115 if not gerrit_ref or not gerrit_repo: | 115 if not gerrit_ref or not gerrit_repo: |
116 gerrit_repo = gerrit_ref = None | 116 gerrit_repo = gerrit_ref = None |
117 assert (gerrit_ref != None) == (gerrit_repo != None) | 117 assert (gerrit_ref != None) == (gerrit_repo != None) |
118 | 118 |
119 # Point to the oauth2 auth files if specified. | 119 # Point to the oauth2 auth files if specified. |
120 # These paths are where the bots put their credential files. | 120 # These paths are where the bots put their credential files. |
121 if patch_oauth2: | 121 if patch_oauth2: |
122 email_file = self.m.infra_paths['build'].join( | 122 email_file = self.m.path['build'].join( |
123 'site_config', '.rietveld_client_email') | 123 'site_config', '.rietveld_client_email') |
124 key_file = self.m.infra_paths['build'].join( | 124 key_file = self.m.path['build'].join( |
125 'site_config', '.rietveld_secret_key') | 125 'site_config', '.rietveld_secret_key') |
126 else: | 126 else: |
127 email_file = key_file = None | 127 email_file = key_file = None |
128 | 128 |
129 # Allow patch_project's revision if necessary. | 129 # Allow patch_project's revision if necessary. |
130 # This is important for projects which are checked out as DEPS of the | 130 # This is important for projects which are checked out as DEPS of the |
131 # gclient solution. | 131 # gclient solution. |
132 self.m.gclient.set_patch_project_revision( | 132 self.m.gclient.set_patch_project_revision( |
133 self.m.properties.get('patch_project'), cfg) | 133 self.m.properties.get('patch_project'), cfg) |
134 | 134 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 else: | 269 else: |
270 # This is actual patch failure. | 270 # This is actual patch failure. |
271 self.m.tryserver.set_patch_failure_tryjob_result() | 271 self.m.tryserver.set_patch_failure_tryjob_result() |
272 self.m.python.failing_step( | 272 self.m.python.failing_step( |
273 'Patch failure', 'Check the bot_update step for details') | 273 'Patch failure', 'Check the bot_update step for details') |
274 | 274 |
275 # bot_update actually just sets root to be the folder name of the | 275 # bot_update actually just sets root to be the folder name of the |
276 # first solution. | 276 # first solution. |
277 if step_result.json.output['did_run']: | 277 if step_result.json.output['did_run']: |
278 co_root = step_result.json.output['root'] | 278 co_root = step_result.json.output['root'] |
279 cwd = kwargs.get('cwd', self.m.infra_paths['slave_build']) | 279 cwd = kwargs.get('cwd', self.m.path['slave_build']) |
280 if 'checkout' not in self.m.path: | 280 if 'checkout' not in self.m.path: |
281 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) | 281 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) |
282 | 282 |
283 return step_result | 283 return step_result |
OLD | NEW |