Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

ignore the state whent a job_id is specified in tasks list #2171

Merged
merged 3 commits into from
Jul 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/cli/onefuzz/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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,
Expand Down