Skip to content

Commit

Permalink
[FIX] import record issue
Browse files Browse the repository at this point in the history
  • Loading branch information
noahzaozao committed Jan 22, 2017
1 parent 19a80eb commit 7d633b1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions connector_dns_dnspod/dnspod.py
Expand Up @@ -111,10 +111,18 @@ def import_record(session, dns_domain_id, data):
record_list_str = ''
for record in result_json['records']:
dns_record_id = dns_record_model.search(
[('name', '=', record['name'])]
[('record_id', '=', record['id'])]
)
if record['type'] == 'NS':
continue
if not dns_record_id:
dns_record_id = dns_record_model.search(
[('name', '=', record['name']),
('domain_id', '=', dns_domain.id),
('type', record['type']),
('line', record['line']),
('value', '=', record['value'])
('mx_priority', record['mx']),
('ttl', record['ttl'])]
)
if dns_record_id:
dns_record_id[0]\
.with_context(connector_no_export=True)\
Expand Down

0 comments on commit 7d633b1

Please sign in to comment.