Skip to content

Commit

Permalink
[uss_qualifier] scd: dss-interop properly handles hostnames that fail…
Browse files Browse the repository at this point in the history
… to resolve (#812)
  • Loading branch information
Shastick authored Oct 24, 2024
1 parent 8fe0d4f commit 18e70fe
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ def _test_env_reqs(self):
"DSS instance is publicly addressable", [dss.participant_id]
) as check:
parsed_url = urlparse(dss.base_url)
ip_addr = socket.gethostbyname(parsed_url.hostname)
try:
ip_addr = socket.gethostbyname(parsed_url.hostname)
# We would typically get a socket.gaierror if the host does not resolve,
# but we catch its parent class socket.error to cover a possibly wider range of issues
except socket.error as e:
check.record_failed(
summary=f"Could not resolve DSS host {parsed_url.netloc}",
details=f"Could not resolve DSS host {parsed_url.netloc}: {e}",
)

if ipaddress.ip_address(ip_addr).is_private:
if self._allow_private_addresses:
Expand Down

0 comments on commit 18e70fe

Please sign in to comment.