diff --git a/awx/main/tests/unit/utils/test_filters.py b/awx/main/tests/unit/utils/test_filters.py index dfa9970bac..ff1ef94048 100644 --- a/awx/main/tests/unit/utils/test_filters.py +++ b/awx/main/tests/unit/utils/test_filters.py @@ -62,8 +62,6 @@ class TestSmartFilterQueryFromString(): ('(a=b and c=d)', Q(**{u"a": u"b"}) & Q(**{u"c": u"d"})), ('a=b or c=d', Q(**{u"a": u"b"}) | Q(**{u"c": u"d"})), ('(a=b and c=d) or (e=f)', (Q(**{u"a": u"b"}) & Q(**{u"c": u"d"})) | (Q(**{u"e": u"f"}))), - #('(a=b and not c=d) or not (e=f)', (Q(**{u"a": u"b"}) & ~Q(**{u"c": u"d"})) | (~Q(**{u"e": u"f"}))), - #('(a=b) and not (c=d or (e=f and (g=h or i=j))) or (y=z)', Q(**{u"a": u"b"}) & ~(Q(**{u"c": u"d"}) | (Q(**{u"e": u"f"}) & (Q(**{u"g": u"h"}) | Q(**{u"i": u"j"})))) | Q(**{u"y": u"z"})), ('a=b or a=d or a=e or a=z and b=h and b=i and b=j and b=k', Q(**{u"a": u"b"}) | Q(**{u"a": u"d"}) | Q(**{u"a": u"e"}) | Q(**{u"a": u"z"}) & Q(**{u"b": u"h"}) & Q(**{u"b": u"i"}) & Q(**{u"b": u"j"}) & Q(**{u"b": u"k"})) ]) def test_boolean_parenthesis(self, mock_get_host_model, filter_string, q_expected): diff --git a/awx/main/utils/filters.py b/awx/main/utils/filters.py index 5bc71327c6..ca58cfa89c 100644 --- a/awx/main/utils/filters.py +++ b/awx/main/utils/filters.py @@ -168,16 +168,6 @@ class SmartFilter(object): return left | right - class BoolNot(object): - def __init__(self, t): - self.right = t[0][1].result - - self.result = self.execute_logic(self.right) - - def execute_logic(self, right): - return ~right - - @classmethod def query_from_string(cls, filter_string): @@ -199,7 +189,6 @@ class SmartFilter(object): grammar.setParseAction(cls.BoolOperand) boolExpr = infixNotation(grammar, [ - #("not", 1, opAssoc.RIGHT, cls.BoolNot), ("and", 2, opAssoc.LEFT, cls.BoolAnd), ("or", 2, opAssoc.LEFT, cls.BoolOr), ])