mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-12 16:40:26 +00:00
Merge pull request #313 from tmuncks/tolerate-pdns-3-api
Tolerate pdns 3.x API deficiencies
This commit is contained in:
commit
501b817808
@ -486,6 +486,10 @@ class Account(db.Model):
|
|||||||
"""
|
"""
|
||||||
Convert account_name to account_id
|
Convert account_name to account_id
|
||||||
"""
|
"""
|
||||||
|
# Skip actual database lookup for empty queries
|
||||||
|
if account_name is None or account_name == "":
|
||||||
|
return None
|
||||||
|
|
||||||
account = Account.query.filter(Account.name == account_name).first()
|
account = Account.query.filter(Account.name == account_name).first()
|
||||||
if account is None:
|
if account is None:
|
||||||
return None
|
return None
|
||||||
@ -759,7 +763,11 @@ class Domain(db.Model):
|
|||||||
|
|
||||||
# update/add new domain
|
# update/add new domain
|
||||||
for data in jdata:
|
for data in jdata:
|
||||||
|
if 'account' in data:
|
||||||
account_id = Account().get_id_by_name(data['account'])
|
account_id = Account().get_id_by_name(data['account'])
|
||||||
|
else:
|
||||||
|
logging.debug("No 'account' data found in API result - Unsupported PowerDNS version?")
|
||||||
|
account_id = None
|
||||||
d = dict_db_domain.get(data['name'].rstrip('.'), None)
|
d = dict_db_domain.get(data['name'].rstrip('.'), None)
|
||||||
changed = False
|
changed = False
|
||||||
if d:
|
if d:
|
||||||
|
Loading…
Reference in New Issue
Block a user