1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Filter DNSimple request by record name. (#49981)

* Filter DNSimple request by record name.

The request was not filtered and DNSimple returns only the first 100
records so if the number of records is larger the check could fail.

This patch fixes the issue and also makes the check to perform better.

* Add changelog fragment.
This commit is contained in:
Albert Cervera i Areny 2019-02-22 09:58:16 +01:00 committed by John R Barker
parent b0fc2a2103
commit e0274adafe
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- fix DNSimple to ensure check works even when the number of records is larger than 100

View file

@ -239,7 +239,7 @@ def main():
# need the not none check since record could be an empty string # need the not none check since record could be an empty string
if domain and record is not None: if domain and record is not None:
records = [r['record'] for r in client.records(str(domain))] records = [r['record'] for r in client.records(str(domain), params={'name': record})]
if not record_type: if not record_type:
module.fail_json(msg="Missing the record type") module.fail_json(msg="Missing the record type")