Fix for rgw still throwing errors
When raising the PollsterPermanentError, the list of resources(tenants) are passed, which enables the Agent Manager to blacklist those resources. This stops those resources from being polled again and avoids any unwanted error messages from being logged. Change-Id: I4f7bf23d5d7f3c182e4089d80b03a1587fa31222 Closes-Bug: #1475441
This commit is contained in:
parent
ece5275fce
commit
833385f846
@ -202,7 +202,7 @@ class PollingTask(object):
|
||||
'Prevent pollster %(name)s for '
|
||||
'polling source %(source)s anymore!')
|
||||
% ({'name': pollster.name, 'source': source_name}))
|
||||
self.resources[key].blacklist.append(err.fail_res)
|
||||
self.resources[key].blacklist.extend(err.fail_res_list)
|
||||
except Exception as err:
|
||||
LOG.warning(_(
|
||||
'Continue after error from %(name)s: %(error)s')
|
||||
|
@ -178,8 +178,8 @@ class PollsterPermanentError(Exception):
|
||||
error.
|
||||
"""
|
||||
|
||||
def __init__(self, resource):
|
||||
self.fail_res = resource
|
||||
def __init__(self, resources):
|
||||
self.fail_res_list = resources
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
|
@ -69,7 +69,7 @@ class _Base(plugin_base.PollsterBase):
|
||||
if (CONF.ipmi.polling_retry >= 0 and
|
||||
self.polling_failures > CONF.ipmi.polling_retry):
|
||||
LOG.warning(_('Pollster for %s is disabled!') % self.NAME)
|
||||
raise plugin_base.PollsterPermanentError(resources[0])
|
||||
raise plugin_base.PollsterPermanentError(resources)
|
||||
else:
|
||||
return
|
||||
|
||||
|
@ -72,7 +72,7 @@ class SensorPollster(plugin_base.PollsterBase):
|
||||
if (CONF.ipmi.polling_retry >= 0 and
|
||||
self.polling_failures > CONF.ipmi.polling_retry):
|
||||
LOG.warning(_('Pollster for %s is disabled!') % self.METRIC)
|
||||
raise plugin_base.PollsterPermanentError(resources[0])
|
||||
raise plugin_base.PollsterPermanentError(resources)
|
||||
else:
|
||||
return
|
||||
|
||||
|
@ -93,8 +93,8 @@ class _Base(plugin_base.PollsterBase):
|
||||
try:
|
||||
from ceilometer.objectstore.rgw_client import RGWAdminClient
|
||||
rgw_client = RGWAdminClient(endpoint, self.access_key, self.secret)
|
||||
except ImportError as e:
|
||||
raise plugin_base.PollsterPermanentError(e)
|
||||
except ImportError:
|
||||
raise plugin_base.PollsterPermanentError(tenants)
|
||||
|
||||
for t in tenants:
|
||||
api_method = 'get_%s' % self.METHOD
|
||||
|
@ -145,7 +145,7 @@ class TestPollsterPollingException(agentbase.TestPollster):
|
||||
# Raise polling exception after 2 times
|
||||
self.polling_failures += 1
|
||||
if self.polling_failures > 2:
|
||||
raise plugin_base.PollsterPermanentError(resources[0])
|
||||
raise plugin_base.PollsterPermanentError(resources)
|
||||
|
||||
return sample
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user