Fix the host_get_all_by_queries() method
Current logic misjudges that a ComputeHost object does not have an attribute which is specified in a query if the value of the attribute is 0 or False. This patch fixes the logic. Change-Id: I9143f11dd022fe3f683c0f3a2a87c3f5562461d8
This commit is contained in:
parent
0770f6acbe
commit
091fed5b58
@ -633,7 +633,7 @@ def host_get_all_by_queries(queries):
|
||||
raise db_exc.BlazarDBInvalidFilter(query_filter=query)
|
||||
|
||||
column = getattr(models.ComputeHost, key, None)
|
||||
if column:
|
||||
if column is not None:
|
||||
if op == 'in':
|
||||
filt = column.in_(value.split(','))
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user