From: Otto Moerbeek Date: Mon, 19 May 2025 13:14:37 +0000 (+0200) Subject: unlink as suggested by @miodvallat X-Git-Tag: dnsdist-2.0.0-alpha2~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15568%2Fhead;p=thirdparty%2Fpdns.git unlink as suggested by @miodvallat --- 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):