mirror of
https://github.com/ansible/awx.git
synced 2026-03-02 09:18:48 -03:30
Revert back to more explicit ParseException
This commit is contained in:
@@ -129,6 +129,7 @@ class TestSmartFilterQueryFromString():
|
||||
q = SmartFilter.query_from_string(filter_string)
|
||||
assert unicode(q) == unicode(q_expected)
|
||||
|
||||
|
||||
'''
|
||||
#('"facts__quoted_val"="f\"oo"', 1),
|
||||
#('facts__facts__arr[]="foo"', 1),
|
||||
|
||||
@@ -6,6 +6,7 @@ from pyparsing import (
|
||||
Optional,
|
||||
Literal,
|
||||
CharsNotIn,
|
||||
ParseException,
|
||||
)
|
||||
|
||||
import django
|
||||
@@ -235,7 +236,7 @@ class SmartFilter(object):
|
||||
|
||||
try:
|
||||
res = boolExpr.parseString('(' + filter_string + ')')
|
||||
except Exception:
|
||||
except ParseException:
|
||||
raise RuntimeError(u"Invalid query %s" % filter_string_raw)
|
||||
|
||||
if len(res) > 0:
|
||||
|
||||
Reference in New Issue
Block a user