Chromium Code Reviews| Index: recipe_modules/bot_update/api.py |
| diff --git a/recipe_modules/bot_update/api.py b/recipe_modules/bot_update/api.py |
| index d88d929938bcbbc954d9e835c5c8eca5f8b6ed02..411c08d28251006ac241849dcef0dd7c3dfc3857 100644 |
| --- a/recipe_modules/bot_update/api.py |
| +++ b/recipe_modules/bot_update/api.py |
| @@ -72,7 +72,8 @@ class BotUpdateApi(recipe_api.RecipeApi): |
| patch=True, update_presentation=True, |
| force=False, patch_root=None, no_shallow=False, |
| with_branch_heads=False, refs=None, |
| - patch_oauth2=False, use_site_config_creds=True, |
| + patch_oauth2=False, oauth2_json=False, |
| + use_site_config_creds=True, |
| output_manifest=True, clobber=False, |
| root_solution_revision=None, rietveld=None, issue=None, |
| patchset=None, gerrit_no_reset=False, |
| @@ -139,7 +140,13 @@ class BotUpdateApi(recipe_api.RecipeApi): |
| # Point to the oauth2 auth files if specified. |
| # These paths are where the bots put their credential files. |
| - if patch_oauth2: |
| + oauth2_json_file = email_file = key_file = None |
| + if oauth2_json: |
| + if self.m.platform.is_win: |
| + oauth2_json_file = 'C:\\creds\\refresh_tokens\\rietveld.json' |
| + else: |
| + oauth2_json_file = '/creds/refresh_tokens/rietveld.json' |
| + elif patch_oauth2: |
|
tandrii(chromium)
2016/09/01 15:49:33
since oauth2_json takes patch_oauth2, i'd add to t
Ryan Tseng
2016/09/19 19:01:27
Done.
|
| # TODO(martiniss): remove this hack :(. crbug.com/624212 |
| if use_site_config_creds: |
| email_file = self.m.path['build'].join( |
| @@ -150,8 +157,6 @@ class BotUpdateApi(recipe_api.RecipeApi): |
| #TODO(martiniss): make this use path.join, so it works on windows |
| email_file = '/creds/rietveld/client_email' |
| key_file = '/creds/rietveld/secret_key' |
| - else: |
| - email_file = key_file = None |
| # Allow patch_project's revision if necessary. |
| # This is important for projects which are checked out as DEPS of the |
| @@ -182,6 +187,7 @@ class BotUpdateApi(recipe_api.RecipeApi): |
| ['--gerrit_ref', gerrit_ref], |
| ['--apply_issue_email_file', email_file], |
| ['--apply_issue_key_file', key_file], |
| + ['--apply_issue_oauth2_file', oauth2_json_file], |
| # 4. Hookups to JSON output back into recipes. |
| ['--output_json', self.m.json.output()],] |