]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
unlink as suggested by @miodvallat 15568/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 19 May 2025 13:14:37 +0000 (15:14 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 19 May 2025 13:18:37 +0000 (15:18 +0200)
pdns/dnsdistdist/dnsdist-rust-lib/dnsdist-settings-generator.py

index 36af03ef4678f3fe2dea0090cc28c9ab19f5d607..27dc9fd40b4a27119a925c711551f4eb095739e8 100644 (file)
@@ -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):