OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import argparse | 5 import argparse |
6 import errno | 6 import errno |
7 import hashlib | 7 import hashlib |
8 import json | 8 import json |
9 import os | 9 import os |
10 import sys | 10 import sys |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 package, version) | 201 package, version) |
202 result = { | 202 result = { |
203 'executable': exe_path, | 203 'executable': exe_path, |
204 'instance_id': instance_id | 204 'instance_id': instance_id |
205 } | 205 } |
206 if opts.json_output: | 206 if opts.json_output: |
207 with open(opts.json_output, 'w') as f: | 207 with open(opts.json_output, 'w') as f: |
208 json.dump(result, f) | 208 json.dump(result, f) |
209 except Exception as e: | 209 except Exception as e: |
210 print 'Exception installing cipd: %s' % e | 210 print 'Exception installing cipd: %s' % e |
211 exc_type, exc_value, exc_traceback = sys.exc_info() | 211 _exc_type, _exc_value, exc_traceback = sys.exc_info() |
212 traceback.print_tb(exc_traceback) | 212 traceback.print_tb(exc_traceback) |
213 return 1 | 213 return 1 |
214 | 214 |
215 return 0 | 215 return 0 |
216 | 216 |
217 if __name__ == '__main__': | 217 if __name__ == '__main__': |
218 sys.exit(main(sys.argv[1:])) | 218 sys.exit(main(sys.argv[1:])) |
OLD | NEW |