From d00aa56d3e07245912bec56d0d8efea6b10aba21 Mon Sep 17 00:00:00 2001 From: ejseqera Date: Thu, 2 Nov 2023 13:13:39 -0400 Subject: [PATCH] fix: multi yaml parsing with same keys --- seqerakit/helper.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/seqerakit/helper.py b/seqerakit/helper.py index c283a73..9751cd7 100644 --- a/seqerakit/helper.py +++ b/seqerakit/helper.py @@ -59,10 +59,12 @@ def parse_all_yaml(file_paths, destroy=False): for file_path in file_paths: with open(file_path, "r") as f: data = yaml.safe_load(f) - # Update merged_data with the content of this file - merged_data.update(data) + for key, value in data.items(): + if key in merged_data: + merged_data[key].extend(value) + else: + merged_data[key] = value - # Get the names of all the blocks/resources to create in the merged data. block_names = list(merged_data.keys()) # Define the order in which the resources should be created.