dns_zone: ensure zone files are sorted
This commit is contained in:
parent
b9dd74af40
commit
9f8dcecf63
1 changed files with 4 additions and 2 deletions
|
@ -293,7 +293,9 @@ def make_records(args, ty):
|
||||||
def zones_eq(lhs: dns.zone.Zone, rhs: dns.zone.Zone) -> bool:
|
def zones_eq(lhs: dns.zone.Zone, rhs: dns.zone.Zone) -> bool:
|
||||||
"""Returns a `bool` indicating whether two `dns.zone.Zone`s are equal
|
"""Returns a `bool` indicating whether two `dns.zone.Zone`s are equal
|
||||||
w.r.t. their text representation."""
|
w.r.t. their text representation."""
|
||||||
return lhs.to_text(relativize=False) == rhs.to_text(relativize=False)
|
return lhs.to_text(relativize=False, sorted=True) == rhs.to_text(
|
||||||
|
relativize=False, sorted=True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def main() -> int:
|
def main() -> int:
|
||||||
|
@ -365,7 +367,7 @@ def main() -> int:
|
||||||
|
|
||||||
changed = current is None or not zones_eq(zone, current)
|
changed = current is None or not zones_eq(zone, current)
|
||||||
if changed:
|
if changed:
|
||||||
zone.to_file(module.params["path"], relativize=False)
|
zone.to_file(module.params["path"], relativize=True, sorted=True)
|
||||||
|
|
||||||
changed = module.set_fs_attributes_if_different(file_args, changed)
|
changed = module.set_fs_attributes_if_different(file_args, changed)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue