File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -311,6 +311,10 @@ def read_configuration(config_path: Path) -> dict:
311
311
312
312
def write_configuration (configuration : dict , config_path : Path ) -> None :
313
313
"""Write a Theengs Gateway configuration to a file."""
314
+ # Ensure discovery_filter is a list before writing
315
+ if isinstance (configuration .get ("discovery_filter" ), str ):
316
+ configuration ["discovery_filter" ] = configuration ["discovery_filter" ].strip ("[]" ).split ("," )
317
+
314
318
try :
315
319
with config_path .open (encoding = "utf-8" , mode = "w" ) as config_file :
316
320
config_file .write (
@@ -338,5 +342,7 @@ def merge_args_with_config(config: dict, args: argparse.Namespace) -> None:
338
342
config [key ].extend (
339
343
element for element in value if element not in config [key ]
340
344
)
345
+ elif key == "discovery_filter" and isinstance (value , str ):
346
+ config [key ] = value .strip ("[]" ).split ("," )
341
347
elif key != "config" :
342
348
config [key ] = value
You can’t perform that action at this time.
0 commit comments