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.

(cherry picked from commit e0274adafe)
pull/52888/head
Albert Cervera i Areny 6 years ago committed by Toshio Kuratomi
parent bcd1289ff2
commit e7cf6b7513

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

@ -236,7 +236,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