Chromium Code Reviews| Index: scripts/slave/recipe_modules/chromite/api.py |
| diff --git a/scripts/slave/recipe_modules/chromite/api.py b/scripts/slave/recipe_modules/chromite/api.py |
| index b7da9be2e63641f0e9ce572e9a6ba7e9cd761aa3..41ee4038f9ec6bb6f351743cdac84d7a17b1262e 100644 |
| --- a/scripts/slave/recipe_modules/chromite/api.py |
| +++ b/scripts/slave/recipe_modules/chromite/api.py |
| @@ -3,6 +3,7 @@ |
| # found in the LICENSE file. |
| import cgi |
| +import json |
|
dnj (Google)
2016/07/20 01:37:06
We actually have a recipe module called "json": ht
nxia1
2016/07/20 05:24:22
looks like it's already imported.
|
| import re |
| from recipe_engine import recipe_api |
| @@ -69,6 +70,11 @@ class ChromiteApi(recipe_api.RecipeApi): |
| } |
| if 'buildnumber' in self.m.properties: |
| defaults['CBB_BUILD_NUMBER'] = int(self.m.properties['buildnumber']) |
| + |
| + if 'buildbucket' in self.m.properties: |
| + buildbucket_json = json.loads(self.m.properties.get('buildbucket')) |
|
dnj (Google)
2016/07/20 01:37:06
Use recipe module "self.m.json.loads" here instead
nxia1
2016/07/20 05:24:22
Done.
|
| + defaults['CBB_BUILDBUCKET_ID'] = buildbucket_json['build']['id'] |
| + |
| return defaults |
| def _load_config_dump(self): |
| @@ -348,6 +354,8 @@ class ChromiteApi(recipe_api.RecipeApi): |
| cbb_args.extend(['--chrome_version', self.c.cbb.chrome_version]) |
| if self.c.cbb.config_repo: |
| cbb_args.extend(['--config_repo', self.c.cbb.config_repo]) |
| + if self.c.cbb.buildbucket_id: |
| + cbb_args.extend(['--buildbucket-id', self.c.cbb.buildbucket_id]) |
| if self.c.repo_cache_dir and self.c.cbb.supports_repo_cache: |
| cbb_args.extend(['--repo-cache', self.c.repo_cache_dir]) |