diff --git a/ocp_resources/node.py b/ocp_resources/node.py index 9f49572264..511c44dd31 100644 --- a/ocp_resources/node.py +++ b/ocp_resources/node.py @@ -14,12 +14,9 @@ class Status(Resource.Status): @property def kubelet_ready(self): return any( - [ - stat - for stat in self.instance.status.conditions - if stat["reason"] == "KubeletReady" - and stat["status"] == self.Condition.Status.TRUE - ] + stat["reason"] == "KubeletReady" + and stat["status"] == self.Condition.Status.TRUE + for stat in self.instance.status.conditions ) @property diff --git a/ocp_resources/virtual_machine_restore.py b/ocp_resources/virtual_machine_restore.py index ff471d9ded..213c263a56 100644 --- a/ocp_resources/virtual_machine_restore.py +++ b/ocp_resources/virtual_machine_restore.py @@ -69,8 +69,7 @@ def wait_complete(self, status=True, timeout=TIMEOUT_4MINUTES): wait_timeout=timeout, sleep=1, exceptions_dict=PROTOCOL_ERROR_EXCEPTION_DICT, - func=lambda: self.instance.get("status", {}).get("complete", None) - == status, + func=lambda: self.instance.get("status", {}).get("complete") == status, ) for sample in samples: if sample: diff --git a/ocp_resources/virtual_machine_snapshot.py b/ocp_resources/virtual_machine_snapshot.py index 16ea87842c..c3dc7929ef 100644 --- a/ocp_resources/virtual_machine_snapshot.py +++ b/ocp_resources/virtual_machine_snapshot.py @@ -66,8 +66,7 @@ def wait_ready_to_use(self, status=True, timeout=TIMEOUT_4MINUTES): wait_timeout=timeout, sleep=1, exceptions_dict=PROTOCOL_ERROR_EXCEPTION_DICT, - func=lambda: self.instance.get("status", {}).get("readyToUse", None) - == status, + func=lambda: self.instance.get("status", {}).get("readyToUse") == status, ) for sample in samples: if sample: