Commit 9340ca09 authored by Ben Pastene's avatar Ben Pastene Committed by Commit Bot

Allow gsutil recipe_module calls to not always be infra_steps.

I'm writing a recipe that makes heavy use of gsutil's ls and cat, and
some of the calls are expected to fail. So this allows the user to make
those that fail do so as normal steps.

R=iannucci, tandrii

Bug: 866062
Change-Id: I4c9cdcb77c00afd4ab8fefd146f22fa94fcc37d7
Reviewed-on: https://chromium-review.googlesource.com/c/1325332Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
parent 1d2946bb
...@@ -622,7 +622,7 @@ Generates a Gitiles repo URL. See also parse_repo_url. ...@@ -622,7 +622,7 @@ Generates a Gitiles repo URL. See also parse_repo_url.
#### **class [GSUtilApi](/recipes/recipe_modules/gsutil/api.py#9)([RecipeApi][recipe_engine/wkt/RecipeApi]):** #### **class [GSUtilApi](/recipes/recipe_modules/gsutil/api.py#9)([RecipeApi][recipe_engine/wkt/RecipeApi]):**
&mdash; **def [\_\_call\_\_](/recipes/recipe_modules/gsutil/api.py#14)(self, cmd, name=None, use_retry_wrapper=True, version=None, parallel_upload=False, multithreaded=False, \*\*kwargs):** &mdash; **def [\_\_call\_\_](/recipes/recipe_modules/gsutil/api.py#14)(self, cmd, name=None, use_retry_wrapper=True, version=None, parallel_upload=False, multithreaded=False, infra_step=True, \*\*kwargs):**
A step to run arbitrary gsutil commands. A step to run arbitrary gsutil commands.
...@@ -639,23 +639,23 @@ Arguments: ...@@ -639,23 +639,23 @@ Arguments:
name: the (string) name of the step to use. name: the (string) name of the step to use.
Defaults to the first non-flag token in the cmd. Defaults to the first non-flag token in the cmd.
&mdash; **def [cat](/recipes/recipe_modules/gsutil/api.py#98)(self, url, args=None, \*\*kwargs):** &mdash; **def [cat](/recipes/recipe_modules/gsutil/api.py#99)(self, url, args=None, \*\*kwargs):**
&mdash; **def [copy](/recipes/recipe_modules/gsutil/api.py#105)(self, source_bucket, source, dest_bucket, dest, args=None, link_name='gsutil.copy', metadata=None, unauthenticated_url=False, \*\*kwargs):** &mdash; **def [copy](/recipes/recipe_modules/gsutil/api.py#106)(self, source_bucket, source, dest_bucket, dest, args=None, link_name='gsutil.copy', metadata=None, unauthenticated_url=False, \*\*kwargs):**
&mdash; **def [download](/recipes/recipe_modules/gsutil/api.py#84)(self, bucket, source, dest, args=None, \*\*kwargs):** &mdash; **def [download](/recipes/recipe_modules/gsutil/api.py#85)(self, bucket, source, dest, args=None, \*\*kwargs):**
&mdash; **def [download\_url](/recipes/recipe_modules/gsutil/api.py#91)(self, url, dest, args=None, \*\*kwargs):** &mdash; **def [download\_url](/recipes/recipe_modules/gsutil/api.py#92)(self, url, dest, args=None, \*\*kwargs):**
&emsp; **@property**<br>&mdash; **def [gsutil\_py\_path](/recipes/recipe_modules/gsutil/api.py#10)(self):** &emsp; **@property**<br>&mdash; **def [gsutil\_py\_path](/recipes/recipe_modules/gsutil/api.py#10)(self):**
&mdash; **def [list](/recipes/recipe_modules/gsutil/api.py#122)(self, url, args=None, \*\*kwargs):** &mdash; **def [list](/recipes/recipe_modules/gsutil/api.py#123)(self, url, args=None, \*\*kwargs):**
&mdash; **def [remove\_url](/recipes/recipe_modules/gsutil/api.py#136)(self, url, args=None, \*\*kwargs):** &mdash; **def [remove\_url](/recipes/recipe_modules/gsutil/api.py#137)(self, url, args=None, \*\*kwargs):**
&mdash; **def [signurl](/recipes/recipe_modules/gsutil/api.py#129)(self, private_key_file, bucket, dest, args=None, \*\*kwargs):** &mdash; **def [signurl](/recipes/recipe_modules/gsutil/api.py#130)(self, private_key_file, bucket, dest, args=None, \*\*kwargs):**
&mdash; **def [upload](/recipes/recipe_modules/gsutil/api.py#68)(self, source, bucket, dest, args=None, link_name='gsutil.upload', metadata=None, unauthenticated_url=False, \*\*kwargs):** &mdash; **def [upload](/recipes/recipe_modules/gsutil/api.py#69)(self, source, bucket, dest, args=None, link_name='gsutil.upload', metadata=None, unauthenticated_url=False, \*\*kwargs):**
### *recipe_modules* / [infra\_paths](/recipes/recipe_modules/infra_paths) ### *recipe_modules* / [infra\_paths](/recipes/recipe_modules/infra_paths)
[DEPS](/recipes/recipe_modules/infra_paths/__init__.py#1): [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/properties][recipe_engine/recipe_modules/properties] [DEPS](/recipes/recipe_modules/infra_paths/__init__.py#1): [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/properties][recipe_engine/recipe_modules/properties]
......
...@@ -12,7 +12,8 @@ class GSUtilApi(recipe_api.RecipeApi): ...@@ -12,7 +12,8 @@ class GSUtilApi(recipe_api.RecipeApi):
return self.package_repo_resource('gsutil.py') return self.package_repo_resource('gsutil.py')
def __call__(self, cmd, name=None, use_retry_wrapper=True, version=None, def __call__(self, cmd, name=None, use_retry_wrapper=True, version=None,
parallel_upload=False, multithreaded=False, **kwargs): parallel_upload=False, multithreaded=False, infra_step=True,
**kwargs):
"""A step to run arbitrary gsutil commands. """A step to run arbitrary gsutil commands.
Note that this assumes that gsutil authentication environment variables Note that this assumes that gsutil authentication environment variables
...@@ -63,7 +64,7 @@ class GSUtilApi(recipe_api.RecipeApi): ...@@ -63,7 +64,7 @@ class GSUtilApi(recipe_api.RecipeApi):
cmd_prefix.append('--') cmd_prefix.append('--')
return self.m.python(full_name, gsutil_path, cmd_prefix + cmd, return self.m.python(full_name, gsutil_path, cmd_prefix + cmd,
infra_step=True, **kwargs) infra_step=infra_step, **kwargs)
def upload(self, source, bucket, dest, args=None, link_name='gsutil.upload', def upload(self, source, bucket, dest, args=None, link_name='gsutil.upload',
metadata=None, unauthenticated_url=False, **kwargs): metadata=None, unauthenticated_url=False, **kwargs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment