@@ -66,6 +66,11 @@ def load_configuration(
66
66
conf = {}
67
67
68
68
for (key , value ) in config_info .items ():
69
+ # ----------------FIX----------------
70
+ if extra_vars .get (key ):
71
+ value = extra_vars [key ]
72
+ del extra_vars [key ]
73
+ # ------------------------------------
69
74
if isinstance (value , dict ) and "type" in value :
70
75
if value ["type" ] == "env" :
71
76
env_key = value ["key" ]
@@ -148,29 +153,28 @@ def load_dynamic_configuration(
148
153
# from elsewhere
149
154
from chaoslib .activity import run_activity
150
155
151
- conf = {}
152
156
secrets = secrets or {}
153
157
154
158
had_errors = False
155
159
logger .debug ("Loading dynamic configuration..." )
156
160
for (key , value ) in config .items ():
157
161
if not (isinstance (value , dict ) and value .get ("type" ) == "probe" ):
158
- conf [key ] = config .get (key , value )
162
+ config [key ] = config .get (key , value )
159
163
continue
160
164
161
165
# we have a dynamic config
162
166
name = value .get ("name" )
163
167
provider_type = value ["provider" ]["type" ]
164
168
value ["provider" ]["secrets" ] = deepcopy (secrets )
165
169
try :
166
- output = run_activity (value , conf , secrets )
170
+ output = run_activity (value , config , secrets )
167
171
except Exception :
168
172
had_errors = True
169
173
logger .debug (f"Failed to load configuration '{ name } '" , exc_info = True )
170
174
continue
171
175
172
176
if provider_type == "python" :
173
- conf [key ] = output
177
+ config [key ] = output
174
178
elif provider_type == "process" :
175
179
if output ["status" ] != 0 :
176
180
had_errors = True
@@ -179,14 +183,14 @@ def load_dynamic_configuration(
179
183
f"from probe '{ name } ': { output ['stderr' ]} "
180
184
)
181
185
else :
182
- conf [key ] = output .get ("stdout" , "" ).strip ()
186
+ config [key ] = output .get ("stdout" , "" ).strip ()
183
187
elif provider_type == "http" :
184
- conf [key ] = output .get ("body" )
188
+ config [key ] = output .get ("body" )
185
189
186
190
if had_errors :
187
191
logger .warning (
188
192
"Some of the dynamic configuration failed to be loaded."
189
193
"Please review the log file for understanding what happened."
190
194
)
191
195
192
- return conf
196
+ return config
0 commit comments