Skip to content

Commit

Permalink
Add deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
David Bouchare committed Aug 26, 2019
1 parent d8c4b9e commit c2de2ca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions datadog/util/hostname.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def get_hostname(from_config=True):
* agent config (datadog.conf, "hostname:")
* 'hostname -f' (on unix)
* socket.gethostname()
:param from_config: hostname lookup from the Datadog agent configuration file
:type from_config: bool
"""

hostname = None
Expand All @@ -56,6 +59,8 @@ def get_hostname(from_config=True):
config = get_config()
config_hostname = config.get('hostname')
if config_hostname and is_valid_hostname(config_hostname):
log.debug("Hostname lookup from agent configuration"
" will be deprecated in an upcoming version of datadogpy")
return config_hostname
except CfgNotFound:
log.debug("No agent or invalid configuration file found")
Expand Down

0 comments on commit c2de2ca

Please sign in to comment.