From 0cc5d75b8dd944f0adcb847a1eb39d692b14a913 Mon Sep 17 00:00:00 2001 From: barryyosi-panw <158817412+barryyosi-panw@users.noreply.github.com> Date: Mon, 16 Dec 2024 14:24:26 +0200 Subject: [PATCH] use deepcopy instead of copy (#4713) * use deepcopy instead of copy * changelog --- .changelog/4713.yml | 4 ++++ demisto_sdk/commands/split/ymlsplitter.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changelog/4713.yml diff --git a/.changelog/4713.yml b/.changelog/4713.yml new file mode 100644 index 00000000000..493ec91bbc1 --- /dev/null +++ b/.changelog/4713.yml @@ -0,0 +1,4 @@ +changes: +- description: Fixed an issue where YmlSplitter attributes were being unintentionally updated. + type: fix +pr_number: 4713 diff --git a/demisto_sdk/commands/split/ymlsplitter.py b/demisto_sdk/commands/split/ymlsplitter.py index f33d4fe5832..977f0991867 100644 --- a/demisto_sdk/commands/split/ymlsplitter.py +++ b/demisto_sdk/commands/split/ymlsplitter.py @@ -4,6 +4,7 @@ import os import re import shutil +from copy import deepcopy from pathlib import Path from typing import Optional @@ -129,7 +130,7 @@ def extract_to_package_format( yaml_out = f"{output_path}/{base_name}.yml" logger.debug(f"Creating yml file: {yaml_out} ...") if self.yml_data: - yaml_obj = self.yml_data.copy() + yaml_obj = deepcopy(self.yml_data) else: yaml_obj = get_file(self.input, raise_on_error=True)