v2 dnsimple api uses type vs record_type (#39301)
* v2 dnsimple api uses type vs record_type https://developer.dnsimple.com/v2/zones/records/#listZoneRecords * replace prio with priority
This commit is contained in:
parent
895c6eea9e
commit
bb6a82d2a9
1 changed files with 6 additions and 6 deletions
|
@ -244,13 +244,13 @@ def main():
|
|||
if not value:
|
||||
module.fail_json(msg="Missing the record value")
|
||||
|
||||
rr = next((r for r in records if r['name'] == record and r['record_type'] == record_type and r['content'] == value), None)
|
||||
rr = next((r for r in records if r['name'] == record and r['type'] == record_type and r['content'] == value), None)
|
||||
|
||||
if state == 'present':
|
||||
changed = False
|
||||
if is_solo:
|
||||
# delete any records that have the same name and record type
|
||||
same_type = [r['id'] for r in records if r['name'] == record and r['record_type'] == record_type]
|
||||
same_type = [r['id'] for r in records if r['name'] == record and r['type'] == record_type]
|
||||
if rr:
|
||||
same_type = [rid for rid in same_type if rid != rr['id']]
|
||||
if same_type:
|
||||
|
@ -260,12 +260,12 @@ def main():
|
|||
changed = True
|
||||
if rr:
|
||||
# check if we need to update
|
||||
if rr['ttl'] != ttl or rr['prio'] != priority:
|
||||
if rr['ttl'] != ttl or rr['priority'] != priority:
|
||||
data = {}
|
||||
if ttl:
|
||||
data['ttl'] = ttl
|
||||
if priority:
|
||||
data['prio'] = priority
|
||||
data['priority'] = priority
|
||||
if module.check_mode:
|
||||
module.exit_json(changed=True)
|
||||
else:
|
||||
|
@ -276,13 +276,13 @@ def main():
|
|||
# create it
|
||||
data = {
|
||||
'name': record,
|
||||
'record_type': record_type,
|
||||
'type': record_type,
|
||||
'content': value,
|
||||
}
|
||||
if ttl:
|
||||
data['ttl'] = ttl
|
||||
if priority:
|
||||
data['prio'] = priority
|
||||
data['priority'] = priority
|
||||
if module.check_mode:
|
||||
module.exit_json(changed=True)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue