From 03aa2aeb09ee7e536696f08c41c0149fd6ba7cf7 Mon Sep 17 00:00:00 2001 From: Artem Rys Date: Sun, 3 Jul 2022 17:21:39 +0200 Subject: [PATCH] fix: no crash if metadata folder exists (#474) --- splunk_add_on_ucc_framework/__init__.py | 2 +- tests/data/package_no_global_config/metadata/.gitkeep | 0 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 tests/data/package_no_global_config/metadata/.gitkeep diff --git a/splunk_add_on_ucc_framework/__init__.py b/splunk_add_on_ucc_framework/__init__.py index 8ef89d7ff..67c7c2033 100644 --- a/splunk_add_on_ucc_framework/__init__.py +++ b/splunk_add_on_ucc_framework/__init__.py @@ -811,7 +811,7 @@ def _generate(source, config, ta_version, outputdir=None): outputdir, ta_name, "metadata", "default.meta" ) if not os.path.exists(default_meta_conf_path): - os.makedirs(os.path.join(outputdir, ta_name, "metadata")) + os.makedirs(os.path.join(outputdir, ta_name, "metadata"), exist_ok=True) with open(default_meta_conf_path, "w") as default_meta_conf_fd: MetaConf().create_default(default_meta_conf_fd) diff --git a/tests/data/package_no_global_config/metadata/.gitkeep b/tests/data/package_no_global_config/metadata/.gitkeep new file mode 100644 index 000000000..e69de29bb