Remove no_resource hack for IPMI pollster

In skip to poll and publish when no resource, no_resource hack is used
for IPMI pollsters. Safe to remove it after enabling local node
resource for IPMI pollster.

Change-Id: I6aecbf86cb57d9b8342d77ca9d16c26d8ace4927
This commit is contained in:
Edwin Zhai 2015-01-30 12:20:14 +08:00
parent b7426c545c
commit 2be9ea11f0
4 changed files with 1 additions and 20 deletions

View File

@ -136,8 +136,7 @@ class PollingTask(object):
self.resources[key].get(discovery_cache))
polling_resources = (source_resources or
pollster_resources)
if not polling_resources and not getattr(
pollster.obj, 'no_resources', False):
if not polling_resources:
LOG.info(_("Skip polling pollster %s, no resources"
" found"), pollster.name)
continue

View File

@ -28,9 +28,6 @@ CONF.import_opt('host', 'ceilometer.service')
@six.add_metaclass(abc.ABCMeta)
class _Base(plugin_base.PollsterBase):
no_resources = True
def __init__(self):
self.nodemanager = node_manager.NodeManager()

View File

@ -29,9 +29,6 @@ class InvalidSensorData(ValueError):
class SensorPollster(plugin_base.PollsterBase):
no_resources = True
METRIC = None
def __init__(self):

View File

@ -703,15 +703,3 @@ class BaseAgentManagerTestCase(base.BaseTestCase):
LOG.info.assert_called_with(
'Skip polling pollster %s, no resources found', pollster.name)
self.assertEqual(0, get_samples._mock_call_count)
setattr(pollster.obj, 'no_resources', False)
polling_task.poll_and_publish()
LOG.info.assert_called_with(
'Skip polling pollster %s, no resources found', pollster.name)
self.assertEqual(0, get_samples._mock_call_count)
setattr(pollster.obj, 'no_resources', True)
polling_task.poll_and_publish()
LOG.info.not_assert_called_with(
'Skip polling pollster %s, no resources found', pollster.name)
self.assertEqual(1, get_samples._mock_call_count)