Skip to content

Commit

Permalink
deprecate 'use_ec2_instance_id'
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Singleton committed Oct 22, 2012
1 parent 2ae7082 commit 3073c60
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
3 changes: 2 additions & 1 deletion agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def run(self, agentConfig=None, run_forever=True):
checksd = load_check_directory(agentConfig)

# Try to fetch instance Id from EC2 if not hostname has been set
# in the config file
# in the config file.
# DEPRECATED
if agentConfig.get('hostname') is None and agentConfig.get('use_ec2_instance_id'):
instanceId = EC2.get_instance_id()
if instanceId is not None:
Expand Down
5 changes: 3 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def get_config(parse_args = True, cfg_path=None, init_logging=False, options=Non
'hostname': None,
'listen_port': None,
'tags': None,
'use_ec2_instance_id': False,
'use_ec2_instance_id': False, # DEPRECATED
'version': get_version(),
'watchdog': True,
}
Expand Down Expand Up @@ -229,6 +229,7 @@ def get_config(parse_args = True, cfg_path=None, init_logging=False, options=Non
# Debug mode
agentConfig['debug_mode'] = config.get('Main', 'debug_mode').lower() in ("yes", "true")

# DEPRECATED
if config.has_option('Main', 'use_ec2_instance_id'):
use_ec2_instance_id = config.get('Main', 'use_ec2_instance_id')
# translate yes into True, the rest into False
Expand Down Expand Up @@ -510,4 +511,4 @@ def load_check_directory(agentConfig):
'class': check_class
})

return checks
return checks
4 changes: 0 additions & 4 deletions datadog.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ debug_mode: no
# Set the host's tags
#tags: mytag0, mytag1

# Use the amazon EC2 instance-id instead of hostname (unless hostname is
# explicitly set)
use_ec2_instance_id: no

# Use mount points instead of volumes to track disk and fs metrics
use_mount: no

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ debug_mode: no
# Set the host's tags
#tags: mytag0, mytag1

# Use the amazon EC2 instance-id instead of hostname (unless hostname is
# explicitly set)
use_ec2_instance_id: yes

# Use mount points instead of volumes to track disk and fs metrics
use_mount: no

Expand Down

0 comments on commit 3073c60

Please sign in to comment.