mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 10:46:06 +02:00
get nameservers from db in the event of registry error retrieving nameservers
This commit is contained in:
parent
7fdc61be46
commit
f5f3b2335b
1 changed files with 6 additions and 5 deletions
|
@ -299,11 +299,12 @@ class Domain(TimeStampedModel, DomainHelper):
|
|||
try:
|
||||
hosts = self._get_property("hosts")
|
||||
except Exception as err:
|
||||
# Do not raise error when missing nameservers
|
||||
# this is a standard occurence when a domain
|
||||
# is first created
|
||||
logger.info("Domain is missing nameservers %s" % err)
|
||||
return []
|
||||
# If exception raised returning hosts from registry, get from db
|
||||
hosts = []
|
||||
for host in self.host.all():
|
||||
host_name = host.name
|
||||
ips = [ip.address for ip in host.ip.all()]
|
||||
hosts.append({"name": host_name, "addrs": ips})
|
||||
|
||||
# TODO-687 fix this return value
|
||||
hostList = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue