Deprecate event trait plugin 'split'

'split' plugin can be replaced by an jsonpath expresion
since jsonpath-rw-ext>=0.1.8.

This change deprecates it

Depends-On: I8cd971d6dd98cd6c4c3dc83696969c47e8cdd8ac
Change-Id: Iac2253c81dacaa1b2a2258569716d20916fc9920
This commit is contained in:
Mehdi Abaakouk 2015-09-17 00:12:00 +02:00 committed by Mehdi Abaakouk (sileht)
parent 6fe1319f66
commit d12d60da15
3 changed files with 16 additions and 9 deletions

View File

@ -15,8 +15,13 @@
import abc
from oslo_log import log
import six
from ceilometer.i18n import _LW
LOG = log.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class TraitPluginBase(object):
@ -102,6 +107,14 @@ class SplitterTraitPlugin(TraitPluginBase):
:param segment: Which segment to return. (int) default 0
:param max_split: Limit number of splits. Default: None (no limit)
"""
LOG.warning(_LW('split plugin is deprecated, '
'add ".`split(%(sep)s, %(segment)d, '
'%(max_split)d)`" to your jsonpath instead') %
dict(sep=separator,
segment=segment,
max_split=(-1 if max_split is None
else max_split)))
self.separator = separator
self.segment = segment
self.max_split = max_split

View File

@ -8,15 +8,9 @@
instance_id:
fields: payload.instance_id
host:
fields: publisher_id
plugin:
name: split
parameters:
segment: 1
max_split: 1
fields: publisher_id.`split(., 1, 1)`
service:
fields: publisher_id
plugin: split
fields: publisher_id.`split(., 0, -1)`
memory_mb:
type: int
fields: payload.memory_mb

View File

@ -5,7 +5,7 @@
retrying!=1.3.0,>=1.2.3 # Apache-2.0
croniter>=0.3.4 # MIT License
eventlet>=0.17.4
jsonpath-rw-ext>=0.1.7
jsonpath-rw-ext>=0.1.9
jsonschema!=2.5.0,<3.0.0,>=2.0.0
kafka-python>=0.9.2 # Apache-2.0
keystonemiddleware>=2.0.0