Skip to content

Commit

Permalink
[util] don't raise on hostname resolution failures
Browse files Browse the repository at this point in the history
`hostname` is an optional API parameter. Thus, `initialize` method
should not raise when unable to resolve it.
  • Loading branch information
yannmh committed Apr 26, 2016
1 parent dbb4285 commit 49cf300
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions datadog/util/hostname.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ def _get_hostname_unix():
hostname = socket_hostname

if hostname is None:
log.critical("Unable to reliably determine host name. You can define one"
" in datadog.conf or in your hosts file")
raise Exception("Unable to reliably determine host name. You can define"
" one in datadog.conf or in your hosts file")
else:
return hostname
log.warning(
u"Unable to reliably determine host name. You can define one in your `hosts` file, "
u"or in `datadog.conf` file if you have Datadog Agent installed."
)

return hostname


def get_ec2_instance_id():
Expand Down

0 comments on commit 49cf300

Please sign in to comment.