From 99a38f8f759914045ca25c0b2db3f458fb7b51a1 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 19 May 2025 15:14:37 +0200 Subject: [PATCH] unlink as suggested by @miodvallat --- .../dnsdist-rust-lib/dnsdist-settings-generator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pdns/dnsdistdist/dnsdist-rust-lib/dnsdist-settings-generator.py b/pdns/dnsdistdist/dnsdist-rust-lib/dnsdist-settings-generator.py index 36af03ef46..27dc9fd40b 100644 --- a/pdns/dnsdistdist/dnsdist-rust-lib/dnsdist-settings-generator.py +++ b/pdns/dnsdistdist/dnsdist-rust-lib/dnsdist-settings-generator.py @@ -378,7 +378,9 @@ void convertRuntimeFlatSettingsFromRust(const dnsdist::rust::settings::GlobalCon os.rename(cxx_flat_settings_fp.name, out_file_path + '/dnsdist-configuration-yaml-items-generated.cc') target = build_dir_path + '/dnsdist-configuration-yaml-items-generated.cc' - if out_file_path != build_dir_path and not os.path.exists(target): + if out_file_path != build_dir_path: + if os.path.exists(target): + os.unlink(target) os.symlink(os.path.abspath(out_file_path + '/dnsdist-configuration-yaml-items-generated.cc'), target) def generate_actions_config(output, def_dir, response, default_functions): -- 2.47.2