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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 # missing, clear both of them. | 123 # missing, clear both of them. |
124 if not gerrit_ref or not gerrit_repo: | 124 if not gerrit_ref or not gerrit_repo: |
125 gerrit_repo = gerrit_ref = None | 125 gerrit_repo = gerrit_ref = None |
126 assert (gerrit_ref != None) == (gerrit_repo != None) | 126 assert (gerrit_ref != None) == (gerrit_repo != None) |
127 | 127 |
128 # Point to the oauth2 auth files if specified. | 128 # Point to the oauth2 auth files if specified. |
129 # These paths are where the bots put their credential files. | 129 # These paths are where the bots put their credential files. |
130 oauth2_json_file = email_file = key_file = None | 130 oauth2_json_file = email_file = key_file = None |
131 if oauth2_json: | 131 if oauth2_json: |
132 if self.m.platform.is_win: | 132 if self.m.platform.is_win: |
133 oauth2_json_file = 'C:\\creds\\refresh_tokens\\rietveld.json' | 133 oauth2_json_file = 'C:\\creds\\refresh_tokens\\internal-try' |
134 else: | 134 else: |
135 oauth2_json_file = '/creds/refresh_tokens/rietveld.json' | 135 oauth2_json_file = '/creds/refresh_tokens/internal-try' |
136 elif patch_oauth2: | 136 elif patch_oauth2: |
137 # TODO(martiniss): remove this hack :(. crbug.com/624212 | 137 # TODO(martiniss): remove this hack :(. crbug.com/624212 |
138 if use_site_config_creds: | 138 if use_site_config_creds: |
139 email_file = self.m.path['build'].join( | 139 email_file = self.m.path['build'].join( |
140 'site_config', '.rietveld_client_email') | 140 'site_config', '.rietveld_client_email') |
141 key_file = self.m.path['build'].join( | 141 key_file = self.m.path['build'].join( |
142 'site_config', '.rietveld_secret_key') | 142 'site_config', '.rietveld_secret_key') |
143 else: #pragma: no cover | 143 else: #pragma: no cover |
144 #TODO(martiniss): make this use path.join, so it works on windows | 144 #TODO(martiniss): make this use path.join, so it works on windows |
145 email_file = '/creds/rietveld/client_email' | 145 email_file = '/creds/rietveld/client_email' |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 292 |
293 # bot_update actually just sets root to be the folder name of the | 293 # bot_update actually just sets root to be the folder name of the |
294 # first solution. | 294 # first solution. |
295 if step_result.json.output['did_run']: | 295 if step_result.json.output['did_run']: |
296 co_root = step_result.json.output['root'] | 296 co_root = step_result.json.output['root'] |
297 cwd = kwargs.get('cwd', self.m.path['slave_build']) | 297 cwd = kwargs.get('cwd', self.m.path['slave_build']) |
298 if 'checkout' not in self.m.path: | 298 if 'checkout' not in self.m.path: |
299 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) | 299 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) |
300 | 300 |
301 return step_result | 301 return step_result |
OLD | NEW |