File tree Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 44
55[ Unreleased ] : https://github.com/chaostoolkit/chaostoolkit-lib/compare/1.27.0...HEAD
66
7+ ### Changed
8+
9+ - Ensure dynamic configuration can reference itself [ #250 ] [ 250 ]
10+
11+ [ 250 ] : https://github.com/chaostoolkit/chaostoolkit-lib/issues/250
12+
713## [ 1.27.0] [ ] - 2022-02-17
814
915[ 1.27.0 ] : https://github.com/chaostoolkit/chaostoolkit-lib/compare/1.26.0...1.27.0
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ def load_dynamic_configuration(
163163 provider_type = value ["provider" ]["type" ]
164164 value ["provider" ]["secrets" ] = deepcopy (secrets )
165165 try :
166- output = run_activity (value , config , secrets )
166+ output = run_activity (value , conf , secrets )
167167 except Exception :
168168 had_errors = True
169169 logger .debug (f"Failed to load configuration '{ name } '" , exc_info = True )
Original file line number Diff line number Diff line change @@ -322,3 +322,31 @@ def test_dynamic_configuration_exception_means_output_is_missing():
322322
323323 assert config ["somekey" ] == "hello world"
324324 assert "token" not in config
325+
326+
327+ def test_dynamic_configuration_can_be_used_next_key ():
328+ config = load_dynamic_configuration (
329+ {
330+ "capped" : {
331+ "type" : "probe" ,
332+ "provider" : {
333+ "type" : "python" ,
334+ "module" : "string" ,
335+ "func" : "capwords" ,
336+ "arguments" : {"s" : "hello world from earth" },
337+ },
338+ },
339+ "shorten" : {
340+ "type" : "probe" ,
341+ "provider" : {
342+ "type" : "python" ,
343+ "module" : "textwrap" ,
344+ "func" : "shorten" ,
345+ "arguments" : {"text" : "${capped}" , "width" : 12 },
346+ },
347+ },
348+ }
349+ )
350+
351+ assert config ["capped" ] == "Hello World From Earth"
352+ assert config ["shorten" ] == "Hello [...]"
You can’t perform that action at this time.
0 commit comments