do not observe queries when constructing them

* While parsing host_filter in the smart inventory code it was
triggering sql queries. This changset avoids executing the query that is
being constructed.
This commit is contained in:
chris meyers 2019-02-08 12:26:11 -05:00
parent 844b0f86b8
commit ed78978b5f

View File

@ -297,7 +297,11 @@ class SmartFilter(object):
self.result = None
i = 2
while i < len(t[0]):
if not self.result:
'''
Do NOT observe self.result. It will cause the sql query to be executed.
We do not want that. We only want to build the query.
'''
if isinstance(self.result, type(None)):
self.result = t[0][0].result
right = t[0][i].result
self.result = self.execute_logic(self.result, right)