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.
pull/52814/head
Albert Cervera i Areny 5 years ago committed by John R Barker
parent b0fc2a2103
commit e0274adafe

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

@ -239,7 +239,7 @@ def main():
# need the not none check since record could be an empty string
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:
module.fail_json(msg="Missing the record type")

Loading…
Cancel
Save