workers.securityworker: simplify min id

This commit is contained in:
Jimmy Zelinskie 2017-03-03 14:50:53 -05:00
parent 591e700892
commit b9ac2b7b3b
3 changed files with 8 additions and 10 deletions

View file

@ -495,13 +495,10 @@ def get_image_id():
return Image.id
def get_images_eligible_for_scan(clair_version, min_id=None):
def get_images_eligible_for_scan(clair_version):
""" Returns a query that gives all images eligible for a clair scan """
query = (get_image_with_storage_and_parent_base()
.where(Image.security_indexed_engine < clair_version))
if min_id is not None:
query = query.where(Image.id >= min_id)
return query
return (get_image_with_storage_and_parent_base()
.where(Image.security_indexed_engine < clair_version))
def get_image_with_storage_and_parent_base():