Chromium Code Reviews| Index: scripts/slave/recipe_modules/goma/api.py |
| diff --git a/scripts/slave/recipe_modules/goma/api.py b/scripts/slave/recipe_modules/goma/api.py |
| index db1b0061f82875595c795a87a8aaae0adf1407aa..f528e9c21e3e05aca072b655b97b8730056319af 100644 |
| --- a/scripts/slave/recipe_modules/goma/api.py |
| +++ b/scripts/slave/recipe_modules/goma/api.py |
| @@ -2,6 +2,8 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| +import os |
| + |
| from recipe_engine import recipe_api |
| class GomaApi(recipe_api.RecipeApi): |
| @@ -12,8 +14,24 @@ class GomaApi(recipe_api.RecipeApi): |
| self._goma_dir = None |
| self._goma_started = False |
| + self.goma_ctl_env_init() |
| + |
| + |
|
Paweł Hajdan Jr.
2016/08/17 06:31:05
nit: Remove redundant empty line (in a class the h
tikuta
2016/08/17 06:57:27
Done.
|
| + def goma_ctl_env_init(self): |
|
Paweł Hajdan Jr.
2016/08/17 06:31:06
Just checking: did you intend to make this part of
tikuta
2016/08/17 06:57:27
Done.
|
| self._goma_ctl_env = {} |
| + # inherit some env vars used in goma_utils.SendGomaTsMon |
|
Paweł Hajdan Jr.
2016/08/17 06:31:05
nit: Start with capital letter (i -> I), end the s
tikuta
2016/08/17 06:57:27
Done.
|
| + for key in ['BUILDBOD_BUILDERNAME', |
|
Paweł Hajdan Jr.
2016/08/17 06:31:05
nit: typo BUILDBOD -> BUILDBOT
tikuta
2016/08/17 06:57:27
Done.
|
| + 'BUILDBOT_MASTERNAME', |
| + 'BUILDBOT_SLAVENAME', |
| + 'BUILDBOT_CLOBBER', |
| + 'TEST_TMPDIR', |
| + 'TMPDIR', |
| + 'TMP', |
| + ]: |
| + if key in os.environ: # pragma: no cover |
| + self._goma_ctl_env[key] = os.environ[key] |
| + |
| @property |
| def service_account_json_path(self): |
| if self.m.platform.is_win: |
| @@ -69,6 +87,9 @@ class GomaApi(recipe_api.RecipeApi): |
| self._goma_ctl_env['GOMA_SERVICE_ACCOUNT_JSON_FILE'] = ( |
| self.service_account_json_path) |
| + # GLOG_log_dir should not be set. |
| + assert env is None or 'GLOG_log_dir' not in env |
| + |
| goma_ctl_start_env = self._goma_ctl_env.copy() |
| if env is not None: |
| @@ -112,7 +133,8 @@ class GomaApi(recipe_api.RecipeApi): |
| ninja_log_exit_status) |
| self._goma_started = False |
| - self._goma_ctl_env = {} |
| + self.goma_ctl_env_init() |
| + |
| def upload_logs(self, ninja_log_outdir=None, ninja_log_compiler=None, |
| ninja_log_command=None, ninja_log_exit_status=None, |
| @@ -145,5 +167,6 @@ class GomaApi(recipe_api.RecipeApi): |
| name=name or 'upload_log', |
| script=self.package_repo_resource( |
| 'scripts', 'slave', 'upload_goma_logs.py'), |
| - args=args |
| + args=args, |
| + env=self._goma_ctl_env |
| ) |