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

Unified Diff: scripts/slave/recipes/infra/recipe_roll_tryjob.py

Issue 1853423002: Fix authutil call (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Whoops double call. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/slave/recipes/infra/recipe_roll_tryjob.expected/bad_patches.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipes/infra/recipe_roll_tryjob.py
diff --git a/scripts/slave/recipes/infra/recipe_roll_tryjob.py b/scripts/slave/recipes/infra/recipe_roll_tryjob.py
index a017dc5e3e5dfe158fbe83d85df577c50acd0636..cfdb1f5999199067c12d8144e67d7a991bf9582b 100644
--- a/scripts/slave/recipes/infra/recipe_roll_tryjob.py
+++ b/scripts/slave/recipes/infra/recipe_roll_tryjob.py
@@ -32,7 +32,7 @@ def get_auth_token(api):
"""
result = api.step('Get auth token',
- ['authutil', 'token',],
+ ['/opt/infra-tools/authutil', 'token',],
stdout=api.raw_io.output(),
step_test_data=lambda: api.raw_io.test_api.stream_output('ya29.foobar'))
return result.stdout.strip()
@@ -343,14 +343,22 @@ PROPERTIES = {
"patch_project": Property(
kind=str, default=None,
help="The luci-config name of the project this patch belongs to"),
+
+ # To generate an auth token for running locally, run
+ # infra/go/bin/authutil login
+ 'auth_token': Property(default=None),
}
-def RunSteps(api, patches_raw, rietveld, issue, patchset, patch_project):
+def RunSteps(api, patches_raw, rietveld, issue, patchset, patch_project,
+ auth_token):
# TODO(martiniss): use real types
issue = int(issue) if issue else None
patchset = int(patchset) if patchset else None
- headers = {'Authorization': 'Bearer %s' % get_auth_token(api)}
+ if not auth_token:
+ auth_token = get_auth_token(api)
+
+ headers = {'Authorization': 'Bearer %s' % auth_token}
patches = parse_patches(
api, patches_raw, rietveld, issue, patchset, patch_project)
« no previous file with comments | « no previous file | scripts/slave/recipes/infra/recipe_roll_tryjob.expected/bad_patches.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698