File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ def get_test_options(
145
145
sub_test_name = opts .sub_test_name if require_sub_test_name else ""
146
146
if require_sub_test_name and test_name in SUB_TEST_REQUIRED and not sub_test_name :
147
147
raise ValueError (f"Test '{ test_name } ' requires a sub_test_name" )
148
- handle_env_overrides (opts )
148
+ handle_env_overrides (parser )
149
149
if "auth" in test_name :
150
150
opts .auth = True
151
151
# 'auth_aws ecs' shouldn't have extra auth set.
@@ -158,15 +158,17 @@ def get_test_options(
158
158
return opts , extra_opts
159
159
160
160
161
- def handle_env_overrides (opts : argparse .Namespace ) -> None :
161
+ def handle_env_overrides (parser : argparse . ArgumentParser , opts : argparse .Namespace ) -> None :
162
162
# Get the options, and then allow environment variable overrides.
163
163
for key in vars (opts ):
164
164
if key in OPTION_TO_ENV_VAR :
165
165
env_var = OPTION_TO_ENV_VAR [key ]
166
166
else :
167
167
env_var = key .upper ()
168
168
if env_var in os .environ :
169
- if env_var == "AUTH" :
169
+ if parser .get_default (key ) != getattr (opts , key ):
170
+ LOGGER .info ("Overriding env var '%s' with cli option" , env_var )
171
+ elif env_var == "AUTH" :
170
172
opts .auth = os .environ .get ("AUTH" ) == "auth"
171
173
elif env_var == "SSL" :
172
174
ssl_opt = os .environ .get ("SSL" , "" )
You can’t perform that action at this time.
0 commit comments