summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib/core/programs.py
diff options
context:
space:
mode:
authorSiran Wang <siran.wang@mongodb.com>2021-07-29 12:53:14 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-30 14:06:16 +0000
commit2fe0fa151f372c76582f9978cc356469c5b4467e (patch)
tree239d28332f3b5d24930ef28bf7040db1f64b0927 /buildscripts/resmokelib/core/programs.py
parent443a0536c04020c21ec5b4b14f18a210314a82a9 (diff)
downloadmongo-2fe0fa151f372c76582f9978cc356469c5b4467e.tar.gz
SERVER-55861 add retryable writes multiversion hook
Diffstat (limited to 'buildscripts/resmokelib/core/programs.py')
-rw-r--r--buildscripts/resmokelib/core/programs.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/buildscripts/resmokelib/core/programs.py b/buildscripts/resmokelib/core/programs.py
index 2a9b3715957..a2d6b3fd5fd 100644
--- a/buildscripts/resmokelib/core/programs.py
+++ b/buildscripts/resmokelib/core/programs.py
@@ -30,21 +30,27 @@ def make_process(*args, **kwargs):
# Add the current working directory and /data/multiversion to the PATH.
env_vars = kwargs.get("env_vars", {}).copy()
+ path = get_path_env_var(env_vars)
+
+ if config.INSTALL_DIR is not None:
+ env_vars["INSTALL_DIR"] = config.INSTALL_DIR
+
+ env_vars["PATH"] = os.pathsep.join(path)
+ kwargs["env_vars"] = env_vars
+ return process_cls(*args, **kwargs)
+
+
+def get_path_env_var(env_vars):
+ """Return the path base on provided environment variable."""
path = [
os.getcwd(),
config.DEFAULT_MULTIVERSION_DIR,
]
-
# If installDir is provided, add it early to the path
if config.INSTALL_DIR is not None:
path.append(config.INSTALL_DIR)
- env_vars["INSTALL_DIR"] = config.INSTALL_DIR
-
path.append(env_vars.get("PATH", os.environ.get("PATH", "")))
-
- env_vars["PATH"] = os.pathsep.join(path)
- kwargs["env_vars"] = env_vars
- return process_cls(*args, **kwargs)
+ return path
def mongod_program(logger, job_num, executable, process_kwargs, mongod_options):