Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristineTChen committed Aug 7, 2019
1 parent b67c9f1 commit 453012e
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions mesos_slave/datadog_checks/mesos_slave/mesos_slave.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,18 @@ class MesosSlave(AgentCheck):
def __init__(self, name, init_config, instances):
super(MesosSlave, self).__init__(name, init_config, instances)
self.cluster_name = None
if self.instance is not None:
url = self.instance.get('url', '')
parsed_url = urlparse(url)
if self.http.options['tls_verify'] and parsed_url.scheme == 'https':
self.log.warning('Skipping TLS cert validation for %s based on configuration.' % url)
if not ('read_timeout' in self.instance or 'connect_timeout' in self.instance):
# `default_timeout` config option will be removed with Agent 5
self.http.options['timeout'] = (
self.instance.get('timeout')
or self.init_config.get('timeout')
or self.init_config.get('default_timeout')
or self.DEFAULT_TIMEOUT
)
url = self.instance.get('url', '')
parsed_url = urlparse(url)
if self.http.options['verify'] and parsed_url.scheme == 'https':
self.log.warning('Skipping TLS cert validation for %s based on configuration.' % url)
if not ('read_timeout' in self.instance or 'connect_timeout' in self.instance):
# `default_timeout` config option will be removed with Agent 5
self.http.options['timeout'] = (
self.instance.get('timeout')
or self.init_config.get('timeout')
or self.init_config.get('default_timeout')
or self.DEFAULT_TIMEOUT
)

def _get_json(self, url, failure_expected=False, tags=None):
tags = tags + ["url:%s" % url] if tags else ["url:%s" % url]
Expand Down

0 comments on commit 453012e

Please sign in to comment.