Merge branch 'split-up-update-method'

This commit is contained in:
Khanh Ngo 2019-09-25 11:47:45 +07:00
commit 0b2eb0fbf8

View File

@ -934,7 +934,6 @@ class Domain(db.Model):
# add new domain
self.add_domain_to_powerdns_admin(domain=data)
logging.info('Update finished')
return {'status': 'ok', 'msg': 'Domain table has been updated successfully'}
except Exception as e:
@ -966,7 +965,6 @@ class Domain(db.Model):
logging.info("Rolledback Domain {0} {1}".format(domain.name, e))
raise
def add(self, domain_name, domain_type, soa_edit_api, domain_ns=[], domain_master_ips=[], account_name=None):
"""
Add a domain to power dns
@ -1009,7 +1007,6 @@ class Domain(db.Model):
logging.debug(traceback.format_exc())
return {'status': 'error', 'msg': 'Cannot add this domain.'}
def add_domain_to_powerdns_admin(self, domain=None, domain_dict=None):
"""
Read Domain from PowerDNS and add into PDNS-Admin
@ -1051,7 +1048,6 @@ class Domain(db.Model):
logging.info("Rolledback Domain {0}".format(d.name))
raise
def update_soa_setting(self, domain_name, soa_edit_api):
domain = Domain.query.filter(Domain.name == domain_name).first()
if not domain:
@ -1460,7 +1456,6 @@ class Record(object):
This is not a model, it's just an object
which be assigned data from PowerDNS API
"""
def __init__(self, name=None, type=None, status=None, ttl=None, data=None):
self.name = name
self.type = type