mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
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:
@@ -297,7 +297,11 @@ class SmartFilter(object):
|
|||||||
self.result = None
|
self.result = None
|
||||||
i = 2
|
i = 2
|
||||||
while i < len(t[0]):
|
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
|
self.result = t[0][0].result
|
||||||
right = t[0][i].result
|
right = t[0][i].result
|
||||||
self.result = self.execute_logic(self.result, right)
|
self.result = self.execute_logic(self.result, right)
|
||||||
|
|||||||
Reference in New Issue
Block a user