1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-21 20:59:10 +00:00

ipa_dnsrecord fix error when using dnsttl and nothing to change (#11559)

* ipa_dnsrecord fix error when using dnsttl and nothing to change

* Add changelog and bump version

* ipa_dnsrecord list comp in dnsrecord_find

Co-authored-by: Felix Fontein <felix@fontein.de>

* 11559 changelog fragment fix capitalization

* ipa_dnsrecord dnsrecord_find ttl transform to integer always

* ipa_dnsrecord dnsrecord_find method refactor

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Dor Breger 2026-03-13 22:01:50 +02:00 committed by GitHub
parent f0e3edc892
commit 3194ed9d36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- ipa_dnsrecord - fix idempotency bug when using ``dnsttl`` due to wrong Python types (https://github.com/ansible-collections/community.general/pull/11559).

View file

@ -206,9 +206,12 @@ class DNSRecordIPAClient(IPAClient):
def dnsrecord_find(self, zone_name, record_name):
if record_name == "@":
return self._post_json(method="dnsrecord_show", name=zone_name, item={"idnsname": record_name, "all": True})
method = "dnsrecord_show"
else:
return self._post_json(method="dnsrecord_find", name=zone_name, item={"idnsname": record_name, "all": True})
method = "dnsrecord_find"
result = self._post_json(method=method, name=zone_name, item={"idnsname": record_name, "all": True})
result["dnsttl"] = [int(v) for v in result["dnsttl"]]
return result
def dnsrecord_add(self, zone_name=None, record_name=None, details=None):
item = dict(idnsname=record_name)