| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 DEPS = [ | 5 DEPS = [ |
| 6 'depot_tools/infra_paths', |
| 6 'gsutil', | 7 'gsutil', |
| 7 'recipe_engine/path', | 8 'recipe_engine/path', |
| 8 ] | 9 ] |
| 9 | 10 |
| 10 | 11 |
| 11 def RunSteps(api): | 12 def RunSteps(api): |
| 12 """Move things around in a loop!""" | 13 """Move things around in a loop!""" |
| 13 local_file = api.path['slave_build'].join('boom') | 14 local_file = api.infra_paths['slave_build'].join('boom') |
| 14 bucket = 'chromium-recipe-test' | 15 bucket = 'chromium-recipe-test' |
| 15 cloud_file = 'some/random/path/to/boom' | 16 cloud_file = 'some/random/path/to/boom' |
| 16 api.gsutil.upload(local_file, bucket, cloud_file, | 17 api.gsutil.upload(local_file, bucket, cloud_file, |
| 17 metadata={ | 18 metadata={ |
| 18 'Test-Field': 'value', | 19 'Test-Field': 'value', |
| 19 'Remove-Me': None, | 20 'Remove-Me': None, |
| 20 'x-custom-field': 'custom-value', | 21 'x-custom-field': 'custom-value', |
| 21 'Cache-Control': 'no-cache', | 22 'Cache-Control': 'no-cache', |
| 22 }, | 23 }, |
| 23 unauthenticated_url=True) | 24 unauthenticated_url=True) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 38 # Non-normalized URL. | 39 # Non-normalized URL. |
| 39 try: | 40 try: |
| 40 api.gsutil.download_url( | 41 api.gsutil.download_url( |
| 41 'https://someotherservice.localhost', | 42 'https://someotherservice.localhost', |
| 42 local_file, | 43 local_file, |
| 43 name='gsutil download url') | 44 name='gsutil download url') |
| 44 except AssertionError: | 45 except AssertionError: |
| 45 pass | 46 pass |
| 46 | 47 |
| 47 new_cloud_file = 'staging/to/boom' | 48 new_cloud_file = 'staging/to/boom' |
| 48 new_local_file = api.path['slave_build'].join('erang') | 49 new_local_file = api.infra_paths['slave_build'].join('erang') |
| 49 api.gsutil.download(bucket, new_cloud_file, new_local_file) | 50 api.gsutil.download(bucket, new_cloud_file, new_local_file) |
| 50 | 51 |
| 51 private_key_file = 'path/to/key' | 52 private_key_file = 'path/to/key' |
| 52 signed_url = api.gsutil.signurl(private_key_file, bucket, cloud_file, | 53 signed_url = api.gsutil.signurl(private_key_file, bucket, cloud_file, |
| 53 name='signed url') | 54 name='signed url') |
| 54 api.gsutil.remove_url('gs://%s/%s' % (bucket, new_cloud_file)) | 55 api.gsutil.remove_url('gs://%s/%s' % (bucket, new_cloud_file)) |
| 55 | 56 |
| 56 api.gsutil.download_with_polling('gs://chromium-recipe-test/foo/bar', | 57 api.gsutil.download_with_polling('gs://chromium-recipe-test/foo/bar', |
| 57 'local/path/for/download', | 58 'local/path/for/download', |
| 58 15, | 59 15, |
| 59 600) | 60 600) |
| 60 | 61 |
| 61 | 62 |
| 62 def GenTests(api): | 63 def GenTests(api): |
| 63 yield api.test('basic') | 64 yield api.test('basic') |
| OLD | NEW |