Skip to content

Commit 81d3ae9

Browse files
committed
fix get_secrets
1 parent e771ee2 commit 81d3ae9

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.evergreen/scripts/setup_tests.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,17 @@ def setup_libmongocrypt():
115115
run_command("chmod +x libmongocrypt/nocrypto/bin/mongocrypt.dll")
116116

117117

118-
def load_config_from_file(path: str | Path):
118+
def load_config_from_file(path: str | Path) -> dict[str, str]:
119119
config = read_env(path)
120120
for key, value in config.items():
121121
write_env(key, value)
122+
return config
122123

123124

124-
def get_secrets(name: str) -> None:
125+
def get_secrets(name: str) -> dict[str, str]:
125126
secrets_dir = Path(f"{DRIVERS_TOOLS}/.evergreen/secrets_handling")
126127
run_command(f"bash {secrets_dir}/setup-secrets.sh {name}", cwd=secrets_dir)
127-
load_config_from_file(secrets_dir / "secrets-export.sh")
128+
return load_config_from_file(secrets_dir / "secrets-export.sh")
128129

129130

130131
def handle_test_env() -> None:
@@ -245,7 +246,7 @@ def handle_test_env() -> None:
245246
write_env("PYMONGO_DISABLE_TEST_COMMANDS", "1")
246247

247248
if test_name == "enterprise_auth":
248-
get_secrets("drivers/enterprise_auth")
249+
config = get_secrets("drivers/enterprise_auth")
249250
if PLATFORM == "windows":
250251
LOGGER.info("Setting GSSAPI_PASS")
251252
write_env("GSSAPI_PASS", config["SASL_PASS"])

.evergreen/scripts/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def get_test_options(
144144
return opts, extra_opts
145145

146146

147-
def read_env(path: Path | str) -> dict[str, Any]:
147+
def read_env(path: Path | str) -> dict[str, str]:
148148
config = dict()
149149
with Path(path).open() as fid:
150150
for line in fid.readlines():

0 commit comments

Comments
 (0)