Fix flake8 errors
Change-Id: Idb1c1fbe9484b118ec6fe20b7176e173c83694a1
This commit is contained in:
parent
674cefe1e7
commit
1f24f46332
|
@ -267,7 +267,7 @@ class Collector(util.Dimensions):
|
||||||
if len(self.collection_results) >= self.pool_size:
|
if len(self.collection_results) >= self.pool_size:
|
||||||
self.pool_full_count += 1
|
self.pool_full_count += 1
|
||||||
if (self.pool_full_count > self.pool_full_max_retries):
|
if (self.pool_full_count > self.pool_full_max_retries):
|
||||||
log.error('Thread Pool full and %d plugins still running for ' +
|
log.error('Thread Pool full and %d plugins still running for '
|
||||||
'%d collection cycles, exiting' %
|
'%d collection cycles, exiting' %
|
||||||
(len(self.collection_results), self.pool_full_count))
|
(len(self.collection_results), self.pool_full_count))
|
||||||
os._exit(1)
|
os._exit(1)
|
||||||
|
|
|
@ -123,7 +123,8 @@ class Apache(checks.AgentCheck):
|
||||||
self.check(instance)
|
self.check(instance)
|
||||||
else:
|
else:
|
||||||
return services_checks.Status.DOWN,
|
return services_checks.Status.DOWN,
|
||||||
"%s is DOWN, error: No metrics available.".format(service_check_name)
|
"{} is DOWN, error: No metrics available.".format(
|
||||||
|
service_check_name)
|
||||||
else:
|
else:
|
||||||
log.debug("Collected {0} metrics for {1} Apache Web Server".format(apache_host,
|
log.debug("Collected {0} metrics for {1} Apache Web Server".format(apache_host,
|
||||||
metric_count))
|
metric_count))
|
||||||
|
|
|
@ -407,8 +407,8 @@ class Ceph(checks.AgentCheck):
|
||||||
# In Luminous the format of output parsed here changed slightly.
|
# In Luminous the format of output parsed here changed slightly.
|
||||||
# Check for both known variations.
|
# Check for both known variations.
|
||||||
ceph_status_plain = ceph_status_plain.split('\n')
|
ceph_status_plain = ceph_status_plain.split('\n')
|
||||||
for l in ceph_status_plain:
|
for raw_line in ceph_status_plain:
|
||||||
line = l.strip(' ')
|
line = raw_line.strip(' ')
|
||||||
if line.startswith('recovery io') or line.startswith('recovery:'):
|
if line.startswith('recovery io') or line.startswith('recovery:'):
|
||||||
metrics.update(self._get_recovery_io(line))
|
metrics.update(self._get_recovery_io(line))
|
||||||
elif line.startswith('client io') or line.startswith('client:'):
|
elif line.startswith('client io') or line.startswith('client:'):
|
||||||
|
|
|
@ -66,7 +66,8 @@ class TCPCheck(ServicesCheck):
|
||||||
addr, port, socket_type, timeout, response_time = self._load_conf(instance)
|
addr, port, socket_type, timeout, response_time = self._load_conf(instance)
|
||||||
dimensions = self._set_dimensions(None, instance)
|
dimensions = self._set_dimensions(None, instance)
|
||||||
if instance.get('host'):
|
if instance.get('host'):
|
||||||
dimensions.update({'url': '%s:%s'.format(instance.get('host'), port)})
|
dimensions.update({'url': '{}:{}'.format(instance.get('host'),
|
||||||
|
port)})
|
||||||
start = time.time()
|
start = time.time()
|
||||||
try:
|
try:
|
||||||
self.log.debug("Connecting to %s %s" % (addr, port))
|
self.log.debug("Connecting to %s %s" % (addr, port))
|
||||||
|
|
Loading…
Reference in New Issue