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

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

Issue 2035863004: gsutil: use depot_tools.gsutil_py_path instead of path['depot_tools'] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 4 years, 6 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 | Annotate | Revision Log
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 import re 5 import re
6 6
7 from recipe_engine import recipe_api 7 from recipe_engine import recipe_api
8 8
9 class GSUtilApi(recipe_api.RecipeApi): 9 class GSUtilApi(recipe_api.RecipeApi):
10 def __call__(self, cmd, name=None, use_retry_wrapper=True, version=None, 10 def __call__(self, cmd, name=None, use_retry_wrapper=True, version=None,
(...skipping 10 matching lines...) Expand all
21 Arguments: 21 Arguments:
22 cmd: list of (string) arguments to pass to gsutil. 22 cmd: list of (string) arguments to pass to gsutil.
23 Include gsutil-level options first (see 'gsutil help options'). 23 Include gsutil-level options first (see 'gsutil help options').
24 name: the (string) name of the step to use. 24 name: the (string) name of the step to use.
25 Defaults to the first non-flag token in the cmd. 25 Defaults to the first non-flag token in the cmd.
26 """ 26 """
27 if not name: 27 if not name:
28 name = (t for t in cmd if not t.startswith('-')).next() 28 name = (t for t in cmd if not t.startswith('-')).next()
29 full_name = 'gsutil ' + name 29 full_name = 'gsutil ' + name
30 30
31 gsutil_path = self.m.path['depot_tools'].join('gsutil.py') 31 gsutil_path = self.m.depot_tools.gsutil_py_path
tandrii(chromium) 2016/06/03 13:28:17 why not move this whole recipe into depot_tools? S
tandrii(chromium) 2016/06/03 13:48:58 discussed in IM: we postpone the actual refactorin
32 cmd_prefix = [] 32 cmd_prefix = []
33 33
34 if use_retry_wrapper: 34 if use_retry_wrapper:
35 # We pass the real gsutil_path to the wrapper so it doesn't have to do 35 # We pass the real gsutil_path to the wrapper so it doesn't have to do
36 # brittle path logic. 36 # brittle path logic.
37 cmd_prefix = ['--', gsutil_path] 37 cmd_prefix = ['--', gsutil_path]
38 gsutil_path = self.resource('gsutil_wrapper.py') 38 gsutil_path = self.resource('gsutil_wrapper.py')
39 39
40 if version: 40 if version:
41 cmd_prefix.extend(['--force-version', version]) 41 cmd_prefix.extend(['--force-version', version])
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 'Content-Language', 202 'Content-Language',
203 'Content-MD5', 203 'Content-MD5',
204 'Content-Type', 204 'Content-Type',
205 ): 205 ):
206 return name 206 return name
207 207
208 # Add provider prefix 208 # Add provider prefix
209 if not provider_prefix: 209 if not provider_prefix:
210 provider_prefix = 'x-goog-meta' 210 provider_prefix = 'x-goog-meta'
211 return '%s-%s' % (provider_prefix, name) 211 return '%s-%s' % (provider_prefix, name)
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/gsutil/__init__.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