OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Wrapper for tests that are run on builders.""" | 7 """Wrapper for tests that are run on builders.""" |
8 | 8 |
9 import fileinput | 9 import fileinput |
10 import optparse | 10 import optparse |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 latest_image_file.close() | 160 latest_image_file.close() |
161 # Convert bin.gz into zip. | 161 # Convert bin.gz into zip. |
162 latest_image = latest_image.replace('.bin.gz', '.zip') | 162 latest_image = latest_image.replace('.bin.gz', '.zip') |
163 version = latest_image.split('-')[1] | 163 version = latest_image.split('-')[1] |
164 zip_base = os.path.join(zip_server_base, channel, board) | 164 zip_base = os.path.join(zip_server_base, channel, board) |
165 return os.path.join(zip_base, version, latest_image) | 165 return os.path.join(zip_base, version, latest_image) |
166 except IOError: | 166 except IOError: |
167 Warning(('Could not use latest link provided, defaulting to parsing' | 167 Warning(('Could not use latest link provided, defaulting to parsing' |
168 ' latest from zip url base.')) | 168 ' latest from zip url base.')) |
169 | 169 |
170 return GetNewestLinkFromZipBase(board, channel, zip_server_base) | 170 try: |
| 171 return GetNewestLinkFromZipBase(board, channel, zip_server_base) |
| 172 except: |
| 173 Warning('Failed to get url from standard zip base. Trying rc.') |
| 174 return GetNewestLinkFromZipBase(board + '-rc', channel, zip_server_base) |
171 | 175 |
172 | 176 |
173 def GrabZipAndExtractImage(zip_url, download_folder, image_name) : | 177 def GrabZipAndExtractImage(zip_url, download_folder, image_name) : |
174 """Downloads the zip and extracts the given image. | 178 """Downloads the zip and extracts the given image. |
175 | 179 |
176 Doesn't re-download if matching version found already in download folder. | 180 Doesn't re-download if matching version found already in download folder. |
177 Args: | 181 Args: |
178 zip_url - url for the image. | 182 zip_url - url for the image. |
179 download_folder - download folder to store zip file and extracted images. | 183 download_folder - download folder to store zip file and extracted images. |
180 image_name - name of the image to extract from the zip file. | 184 image_name - name of the image to extract from the zip file. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 options.remote) | 298 options.remote) |
295 | 299 |
296 | 300 |
297 if __name__ == '__main__': | 301 if __name__ == '__main__': |
298 try: | 302 try: |
299 main() | 303 main() |
300 except Exception: | 304 except Exception: |
301 print "Got exception." | 305 print "Got exception." |
302 traceback.print_exc(file=sys.stdout) | 306 traceback.print_exc(file=sys.stdout) |
303 | 307 |
OLD | NEW |