File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -115,16 +115,17 @@ def setup_libmongocrypt():
115
115
run_command ("chmod +x libmongocrypt/nocrypto/bin/mongocrypt.dll" )
116
116
117
117
118
- def load_config_from_file (path : str | Path ):
118
+ def load_config_from_file (path : str | Path ) -> dict [ str , str ] :
119
119
config = read_env (path )
120
120
for key , value in config .items ():
121
121
write_env (key , value )
122
+ return config
122
123
123
124
124
- def get_secrets (name : str ) -> None :
125
+ def get_secrets (name : str ) -> dict [ str , str ] :
125
126
secrets_dir = Path (f"{ DRIVERS_TOOLS } /.evergreen/secrets_handling" )
126
127
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" )
128
129
129
130
130
131
def handle_test_env () -> None :
@@ -245,7 +246,7 @@ def handle_test_env() -> None:
245
246
write_env ("PYMONGO_DISABLE_TEST_COMMANDS" , "1" )
246
247
247
248
if test_name == "enterprise_auth" :
248
- get_secrets ("drivers/enterprise_auth" )
249
+ config = get_secrets ("drivers/enterprise_auth" )
249
250
if PLATFORM == "windows" :
250
251
LOGGER .info ("Setting GSSAPI_PASS" )
251
252
write_env ("GSSAPI_PASS" , config ["SASL_PASS" ])
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ def get_test_options(
144
144
return opts , extra_opts
145
145
146
146
147
- def read_env (path : Path | str ) -> dict [str , Any ]:
147
+ def read_env (path : Path | str ) -> dict [str , str ]:
148
148
config = dict ()
149
149
with Path (path ).open () as fid :
150
150
for line in fid .readlines ():
You can’t perform that action at this time.
0 commit comments