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)
This commit is contained in:
Albert Cervera i Areny 2019-02-22 09:58:16 +01:00 committed by Toshio Kuratomi
parent bcd1289ff2
commit e7cf6b7513
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

@ -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")