Reduce code complexity - api.py
Reduce the code complexity in nova/db/sqlalchemy/apy.py file. The 351176 patch depends by this. Change-Id: I39adb817b5e03b39a17df6f64152ce23ef3c9ed6
This commit is contained in:
@@ -2153,10 +2153,8 @@ def instance_get_all_by_filters_sort(context, filters, limit=None, marker=None,
|
|||||||
query_prefix = query_prefix.filter(not_soft_deleted)
|
query_prefix = query_prefix.filter(not_soft_deleted)
|
||||||
|
|
||||||
if 'cleaned' in filters:
|
if 'cleaned' in filters:
|
||||||
if filters.pop('cleaned'):
|
cleaned = 1 if filters.pop('cleaned') else 0
|
||||||
query_prefix = query_prefix.filter(models.Instance.cleaned == 1)
|
query_prefix = query_prefix.filter(models.Instance.cleaned == cleaned)
|
||||||
else:
|
|
||||||
query_prefix = query_prefix.filter(models.Instance.cleaned == 0)
|
|
||||||
|
|
||||||
if 'tags' in filters:
|
if 'tags' in filters:
|
||||||
tags = filters.pop('tags')
|
tags = filters.pop('tags')
|
||||||
|
|||||||
Reference in New Issue
Block a user