Remove disabled_notification_listeners option
This is now deprecated with pipeline usage. Blueprint: remove-disabled-pollsters-option Change-Id: I6d25b47d06ec1d500be8c49328b528ffe18d00bf Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
6381ce2dc4
commit
94c7aa20d3
@ -19,9 +19,9 @@
|
||||
from oslo.config import cfg
|
||||
import msgpack
|
||||
import socket
|
||||
from stevedore import extension
|
||||
|
||||
from ceilometer.publisher import meter as publisher_meter
|
||||
from ceilometer import extension_manager
|
||||
from ceilometer.service import prepare_service
|
||||
from ceilometer.openstack.common import context
|
||||
from ceilometer.openstack.common import log
|
||||
@ -36,10 +36,6 @@ from ceilometer import storage
|
||||
from ceilometer import transformer
|
||||
|
||||
OPTS = [
|
||||
cfg.ListOpt('disabled_notification_listeners',
|
||||
default=[],
|
||||
help='list of listener plugins to disable',
|
||||
deprecated_group="DEFAULT"),
|
||||
cfg.StrOpt('udp_address',
|
||||
default='0.0.0.0',
|
||||
help='address to bind the UDP socket to'
|
||||
@ -135,10 +131,9 @@ class CollectorService(rpc_service.Service):
|
||||
LOG.debug('loading notification handlers from %s',
|
||||
self.COLLECTOR_NAMESPACE)
|
||||
self.notification_manager = \
|
||||
extension_manager.ActivatedExtensionManager(
|
||||
extension.ExtensionManager(
|
||||
namespace=self.COLLECTOR_NAMESPACE,
|
||||
disabled_names=
|
||||
cfg.CONF.collector.disabled_notification_listeners,
|
||||
invoke_on_load=True,
|
||||
)
|
||||
|
||||
if not list(self.notification_manager):
|
||||
|
@ -1,71 +0,0 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
#
|
||||
# Copyright © 2012 New Dream Network, LLC (DreamHost)
|
||||
#
|
||||
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
"""Base class for plugin loader.
|
||||
"""
|
||||
|
||||
from stevedore import enabled
|
||||
|
||||
from ceilometer.openstack.common import log
|
||||
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
def should_use_extension(namespace, ext, disabled_names):
|
||||
"""Return boolean indicating whether the extension
|
||||
should be used.
|
||||
|
||||
Tests the extension against a couple of criteria to see whether it
|
||||
should be used, logs the reason it is not used if not, and then
|
||||
returns the result.
|
||||
"""
|
||||
if ext.name in disabled_names:
|
||||
LOG.debug(
|
||||
'%s extension %r disabled through configuration setting',
|
||||
namespace, ext.name,
|
||||
)
|
||||
return False
|
||||
if not ext.obj.is_enabled():
|
||||
LOG.debug(
|
||||
'%s extension %r reported that it is disabled',
|
||||
namespace,
|
||||
ext.name,
|
||||
)
|
||||
return False
|
||||
LOG.debug('using %s extension %r', namespace, ext.name)
|
||||
return True
|
||||
|
||||
|
||||
class ActivatedExtensionManager(enabled.EnabledExtensionManager):
|
||||
"""Loads extensions based on a configurable set that should be
|
||||
disabled and asking each one if it should be active or not.
|
||||
"""
|
||||
|
||||
def __init__(self, namespace, disabled_names, invoke_on_load=True,
|
||||
invoke_args=(), invoke_kwds={}):
|
||||
|
||||
def local_check_func(ext):
|
||||
return should_use_extension(namespace, ext, disabled_names)
|
||||
|
||||
super(ActivatedExtensionManager, self).__init__(
|
||||
namespace=namespace,
|
||||
check_func=local_check_func,
|
||||
invoke_on_load=invoke_on_load,
|
||||
invoke_args=invoke_args,
|
||||
invoke_kwds=invoke_kwds,
|
||||
)
|
@ -42,7 +42,6 @@ control_exchange ceilometer AMQP exch
|
||||
periodic_interval 600 seconds between running periodic tasks
|
||||
database_connection mongodb://localhost:27017/ceilometer Database connection string
|
||||
metering_api_port 8777 The port for the ceilometer API server
|
||||
disabled_notification_listeners List of notification listeners to skip loading
|
||||
reseller_prefix AUTH\_ Prefix used by swift for reseller token
|
||||
=============================== ==================================== ==============================================================
|
||||
|
||||
|
@ -580,9 +580,6 @@
|
||||
# Options defined in ceilometer.collector.service
|
||||
#
|
||||
|
||||
# list of listener plugins to disable (list value)
|
||||
#disabled_notification_listeners=
|
||||
|
||||
# address to bind the UDP socket todisabled if set to an empty
|
||||
# string (string value)
|
||||
#udp_address=0.0.0.0
|
||||
@ -617,4 +614,4 @@
|
||||
#password=<None>
|
||||
|
||||
|
||||
# Total option count: 118
|
||||
# Total option count: 117
|
||||
|
Loading…
x
Reference in New Issue
Block a user