Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Side by Side Diff: scripts/slave/recipe_modules/gsutil/example.py

Issue 1917243002: Revert "build: roll infra_paths changes" (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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',
7 'gsutil', 6 'gsutil',
8 'recipe_engine/path', 7 'recipe_engine/path',
9 ] 8 ]
10 9
11 10
12 def RunSteps(api): 11 def RunSteps(api):
13 """Move things around in a loop!""" 12 """Move things around in a loop!"""
14 local_file = api.infra_paths['slave_build'].join('boom') 13 local_file = api.path['slave_build'].join('boom')
15 bucket = 'chromium-recipe-test' 14 bucket = 'chromium-recipe-test'
16 cloud_file = 'some/random/path/to/boom' 15 cloud_file = 'some/random/path/to/boom'
17 api.gsutil.upload(local_file, bucket, cloud_file, 16 api.gsutil.upload(local_file, bucket, cloud_file,
18 metadata={ 17 metadata={
19 'Test-Field': 'value', 18 'Test-Field': 'value',
20 'Remove-Me': None, 19 'Remove-Me': None,
21 'x-custom-field': 'custom-value', 20 'x-custom-field': 'custom-value',
22 'Cache-Control': 'no-cache', 21 'Cache-Control': 'no-cache',
23 }, 22 },
24 unauthenticated_url=True) 23 unauthenticated_url=True)
(...skipping 14 matching lines...) Expand all
39 # Non-normalized URL. 38 # Non-normalized URL.
40 try: 39 try:
41 api.gsutil.download_url( 40 api.gsutil.download_url(
42 'https://someotherservice.localhost', 41 'https://someotherservice.localhost',
43 local_file, 42 local_file,
44 name='gsutil download url') 43 name='gsutil download url')
45 except AssertionError: 44 except AssertionError:
46 pass 45 pass
47 46
48 new_cloud_file = 'staging/to/boom' 47 new_cloud_file = 'staging/to/boom'
49 new_local_file = api.infra_paths['slave_build'].join('erang') 48 new_local_file = api.path['slave_build'].join('erang')
50 api.gsutil.download(bucket, new_cloud_file, new_local_file) 49 api.gsutil.download(bucket, new_cloud_file, new_local_file)
51 50
52 private_key_file = 'path/to/key' 51 private_key_file = 'path/to/key'
53 signed_url = api.gsutil.signurl(private_key_file, bucket, cloud_file, 52 signed_url = api.gsutil.signurl(private_key_file, bucket, cloud_file,
54 name='signed url') 53 name='signed url')
55 api.gsutil.remove_url('gs://%s/%s' % (bucket, new_cloud_file)) 54 api.gsutil.remove_url('gs://%s/%s' % (bucket, new_cloud_file))
56 55
57 api.gsutil.download_with_polling('gs://chromium-recipe-test/foo/bar', 56 api.gsutil.download_with_polling('gs://chromium-recipe-test/foo/bar',
58 'local/path/for/download', 57 'local/path/for/download',
59 15, 58 15,
60 600) 59 600)
61 60
62 61
63 def GenTests(api): 62 def GenTests(api):
64 yield api.test('basic') 63 yield api.test('basic')
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/gsutil/api.py ('k') | scripts/slave/recipe_modules/gsutil/example.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698