fixed minor bug and formatting

This commit is contained in:
David Kennedy 2023-12-21 13:55:23 -05:00
parent bd3c150067
commit ed7868efba
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
2 changed files with 12 additions and 11 deletions

View file

@ -298,12 +298,12 @@ class Domain(TimeStampedModel, DomainHelper):
try:
# attempt to retrieve hosts from registry and store in cache and db
hosts = self._get_property("hosts")
except Exception as err:
except Exception:
# 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()]
for hostobj in self.host.all():
host_name = hostobj.name
ips = [ip.address for ip in hostobj.ip.all()]
hosts.append({"name": host_name, "addrs": ips})
# TODO-687 fix this return value