Fix problem with pyparsing.operatorPrecedence method
Pyparsing library was recently updated in golab requiremnts [1]. Since version 3.0.0 operatorPrecedence method was renamed to infixNotation [2]. [1]62f92c0187
[2]16b766b97c/CHANGES (L598)
Change-Id: I3bfefe5b9bc601f383e0b9d80046de387e420fd8
This commit is contained in:
parent
95747eec73
commit
0b63819ff1
|
@ -77,7 +77,7 @@ pycparser==2.18
|
||||||
Pygments==2.2.0
|
Pygments==2.2.0
|
||||||
pyinotify==0.9.6
|
pyinotify==0.9.6
|
||||||
PyMySQL==0.8.0
|
PyMySQL==0.8.0
|
||||||
pyparsing==2.1.0
|
pyparsing==3.0.6
|
||||||
pyperclip==1.5.27
|
pyperclip==1.5.27
|
||||||
python-dateutil==2.5.3
|
python-dateutil==2.5.3
|
||||||
python-editor==1.0.3
|
python-editor==1.0.3
|
||||||
|
|
|
@ -300,9 +300,9 @@ sub_expression = ((function_and_metric | metric) + relational_op + threshold +
|
||||||
sub_expression.setParseAction(SubExpr)
|
sub_expression.setParseAction(SubExpr)
|
||||||
|
|
||||||
expression = (
|
expression = (
|
||||||
pyparsing.operatorPrecedence(sub_expression,
|
pyparsing.infixNotation(sub_expression,
|
||||||
[(AND, 2, pyparsing.opAssoc.LEFT, AndSubExpr),
|
[(AND, 2, pyparsing.opAssoc.LEFT, AndSubExpr),
|
||||||
(OR, 2, pyparsing.opAssoc.LEFT, OrSubExpr)]))
|
(OR, 2, pyparsing.opAssoc.LEFT, OrSubExpr)]))
|
||||||
|
|
||||||
|
|
||||||
class AlarmExprParser(object):
|
class AlarmExprParser(object):
|
||||||
|
|
|
@ -73,7 +73,7 @@ class TestAlarmExpression(base.BaseTestCase):
|
||||||
sub_exprs = alarm_expr_parser.AlarmExprParser(expression).sub_expr_list
|
sub_exprs = alarm_expr_parser.AlarmExprParser(expression).sub_expr_list
|
||||||
print([x.dimensions_as_list for x in sub_exprs].__str__())
|
print([x.dimensions_as_list for x in sub_exprs].__str__())
|
||||||
self.assertEqual([x.dimensions_as_list for x in sub_exprs].__str__(),
|
self.assertEqual([x.dimensions_as_list for x in sub_exprs].__str__(),
|
||||||
"[(['hostname=fred'], {}), [], []]")
|
"[ParseResults(['hostname=fred'], {}), [], []]")
|
||||||
|
|
||||||
def test_operator(self):
|
def test_operator(self):
|
||||||
expression = self.good_simple_expression
|
expression = self.good_simple_expression
|
||||||
|
|
|
@ -19,7 +19,7 @@ Paste>=2.0.2 # MIT
|
||||||
PasteDeploy>=1.5.0 # MIT
|
PasteDeploy>=1.5.0 # MIT
|
||||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||||
six>=1.12.0 # MIT
|
six>=1.12.0 # MIT
|
||||||
pyparsing>=2.1.0 # MIT
|
pyparsing>=3.0.6 # MIT
|
||||||
voluptuous>=0.11.1 # BSD License
|
voluptuous>=0.11.1 # BSD License
|
||||||
eventlet!=0.18.3,!=0.20.1,!=0.21.0,!=0.23.0,!=0.25.0,>=0.18.2 # MIT
|
eventlet!=0.18.3,!=0.20.1,!=0.21.0,!=0.23.0,!=0.25.0,>=0.18.2 # MIT
|
||||||
monasca-common>=2.16.0 # Apache-2.0
|
monasca-common>=2.16.0 # Apache-2.0
|
||||||
|
|
Loading…
Reference in New Issue