When a signed zone is served by the same nameserver instance as
its parent, the child's dnssec-signzone has already written
dsset-<child>. into that directory. Don't attempt to copy the dsset if
the destination and source files are the same.
Assisted-by: Claude:claude-opus-4-8
"""
assert self.zone is not None, "write_dsset requires a zone-attached key"
src = Path(self.zone.ns.name) / f"dsset-{self.zone.name}."
- shutil.copy(src, Path(target_dir))
+ dst = Path(target_dir) / src.name
+ if src.resolve() == dst.resolve():
+ debug(f"{self.zone.name}: dsset already in {target_dir}")
+ return
+ shutil.copy(src, dst)
debug(f"{self.zone.name}: dsset copied to {target_dir}")
@staticmethod