Merge "pipeline: remove polling fallback support"

This commit is contained in:
Zuul 2017-10-18 09:42:02 +00:00 committed by Gerrit Code Review
commit 41d380f0e3
3 changed files with 7 additions and 37 deletions

View File

@ -871,13 +871,7 @@ class PollingManager(ConfigManagerBase):
"""
super(PollingManager, self).__init__(conf)
try:
cfg = self.load_config(cfg_file)
except (TypeError, IOError):
LOG.warning('Using the pipeline configuration for polling '
'is deprecated. %s should '
'be used instead.', cfg_file)
cfg = self.load_config(conf.pipeline_cfg_file)
cfg = self.load_config(cfg_file)
self.sources = []
if 'sources' not in cfg:
raise PollingException("sources required", cfg)

View File

@ -19,13 +19,10 @@
import abc
import copy
import datetime
import os
import tempfile
import mock
import six
from stevedore import extension
import yaml
from ceilometer.agent import plugin_base
from ceilometer import pipeline
@ -362,33 +359,6 @@ class BaseAgentManagerTestCase(base.BaseTestCase):
self.addCleanup(mgr.terminate)
mgr.create_polling_task.assert_called_once_with()
def test_agent_manager_start_fallback(self):
pipeline_cfg = {
'sources': [{
'name': 'test_pipeline',
'interval': 60,
'meters': ['test'],
'resources': ['test://'],
'sinks': ['test_sink']}],
'sinks': [{
'name': 'test_sink',
'transformers': [],
'publishers': ["test"]}]
}
tmp_cfg = tempfile.NamedTemporaryFile(mode='w', delete=False)
tmp_cfg.write(yaml.safe_dump(pipeline_cfg))
tmp_cfg.close()
self.CONF.set_override('pipeline_cfg_file', tmp_cfg.name)
self.CONF.set_override('cfg_file', None, group='polling')
mgr = self.create_manager()
mgr.extensions = self.mgr.extensions
mgr.create_polling_task = mock.MagicMock()
mgr.run()
self.addCleanup(mgr.terminate)
self.addCleanup(os.unlink, tmp_cfg.name)
mgr.create_polling_task.assert_called_once_with()
def test_manager_exception_persistency(self):
self.polling_cfg['sources'].append({
'name': 'test_polling_1',

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
The deprecated support of configure polling in the `pipeline.yaml` file has
been removed. Ceilometer now only uses the `polling.yaml` file for polling
configuration.