ignore nodes already scheduled for re-imaging in outdated check (#341)

If a node is already scheduled to be reimaged/deleted, we should not bother checking if it's outdated.
This commit is contained in:
bmc-msft
2020-11-30 12:36:15 -05:00
committed by GitHub
parent 2391d927f7
commit 30cc5d4778
2 changed files with 13 additions and 1 deletions

View File

@ -46,6 +46,7 @@ from .updates import queue_update
A = TypeVar("A", bound="ORMMixin")
QUERY_VALUE_TYPES = Union[
List[bool],
List[int],
List[str],
List[UUID],
@ -135,6 +136,12 @@ def build_filters(
field_name = field
parts: Optional[List[str]] = None
if isinstance(values[0], bool):
parts = []
for x in values:
if not isinstance(x, bool):
raise TypeError("unexpected type")
parts.append("%s eq %s" % (field_name, str(x).lower))
if isinstance(values[0], int):
parts = []
for x in values: