From 08fb29fc6b85c1fcb640a0e3b092d19a55b24194 Mon Sep 17 00:00:00 2001 From: Cheick Keita Date: Thu, 21 Jul 2022 11:25:39 -0700 Subject: [PATCH] ignore the state when a job_id is specified in tasks list (#2171) --- src/cli/onefuzz/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cli/onefuzz/api.py b/src/cli/onefuzz/api.py index 1bdeff1f2f..ff72cbc8cd 100644 --- a/src/cli/onefuzz/api.py +++ b/src/cli/onefuzz/api.py @@ -930,7 +930,7 @@ def create( def list( self, job_id: Optional[UUID_EXPANSION] = None, - state: Optional[List[enums.TaskState]] = enums.TaskState.available(), + state: Optional[List[enums.TaskState]] = None, ) -> List[models.Task]: """Get information about all tasks""" self.logger.debug("list tasks") @@ -943,6 +943,9 @@ def list( lambda: [str(x.job_id) for x in self.onefuzz.jobs.list()], ) + if job_id_expanded is None and state is None: + state = enums.TaskState.available() + return self._req_model_list( "GET", models.Task,