Use jsonpath_rw_ext for meter/event definitions

This change replace jsonpath_rw per jsonpath_rw_exta
for parsing meter/event definitions.

Depends-On: I4ebf773fd8e01185d3d1946c971d98f5c15e610a
Change-Id: I2e561e7f8a1c73b1eea561614c379d5ea207a363
This commit is contained in:
Mehdi Abaakouk 2015-08-21 17:29:01 +02:00 committed by Mehdi Abaakouk (sileht)
parent 204fe38780
commit 18b8e2f28a
3 changed files with 7 additions and 4 deletions

View File

@ -16,7 +16,7 @@
import fnmatch
import os
import jsonpath_rw
from jsonpath_rw_ext import parser
from oslo_config import cfg
from oslo_log import log
from oslo_utils import timeutils
@ -59,6 +59,8 @@ class EventDefinitionException(Exception):
class TraitDefinition(object):
JSONPATH_RW_PARSER = parser.ExtentedJsonPathParser()
def __init__(self, name, trait_cfg, plugin_manager):
self.cfg = trait_cfg
self.name = name
@ -106,7 +108,7 @@ class TraitDefinition(object):
else:
fields = '|'.join('(%s)' % path for path in fields)
try:
self.fields = jsonpath_rw.parse(fields)
self.fields = self.JSONPATH_RW_PARSER.parse(fields)
except Exception as e:
raise EventDefinitionException(
_("Parse error in JSONPath specification "

View File

@ -19,7 +19,7 @@ import pkg_resources
import six
import yaml
from jsonpath_rw import parser
from jsonpath_rw_ext import parser
from oslo_config import cfg
from oslo_log import log
import oslo_messaging
@ -53,7 +53,7 @@ class MeterDefinitionException(Exception):
class MeterDefinition(object):
JSONPATH_RW_PARSER = parser.JsonPathParser()
JSONPATH_RW_PARSER = parser.ExtentedJsonPathParser()
def __init__(self, definition_cfg):
self.cfg = definition_cfg

View File

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