Skip to content

Commit 82599c8

Browse files
committed
better string formatting for list + comment
1 parent 0ee8caa commit 82599c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bin/tflocal

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,10 @@ def generate_s3_backend_config() -> str:
307307
config_options += f"\n{value}"
308308
continue
309309
elif isinstance(value, list):
310-
value = json.dumps(value)
310+
# TODO this will break if it's a list of dicts or other complex object
311+
# this serialization logic should probably be moved to a separate recursive function
312+
as_string = [f'"{item}"' for item in value]
313+
value = f'[{", ".join(as_string)}]'
311314
else:
312315
value = f'"{str(value)}"'
313316
config_options += f'\n {key} = {value}'

0 commit comments

Comments
 (0)