mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-20 05:23:44 +00:00
use the primitive types in more places (#514)
This commit is contained in:
@ -49,7 +49,7 @@ def check_container(
|
||||
compare: Compare,
|
||||
expected: int,
|
||||
container_type: ContainerType,
|
||||
containers: Dict[ContainerType, List[str]],
|
||||
containers: Dict[ContainerType, List[Container]],
|
||||
) -> None:
|
||||
actual = len(containers.get(container_type, []))
|
||||
if not check_val(compare, expected, actual):
|
||||
@ -62,7 +62,7 @@ def check_container(
|
||||
def check_containers(definition: TaskDefinition, config: TaskConfig) -> None:
|
||||
checked = set()
|
||||
|
||||
containers: Dict[ContainerType, List[str]] = {}
|
||||
containers: Dict[ContainerType, List[Container]] = {}
|
||||
for container in config.containers:
|
||||
if container.name not in checked:
|
||||
if not container_exists(container.name, StorageType.corpus):
|
||||
|
@ -18,6 +18,7 @@ from onefuzztypes.events import (
|
||||
from onefuzztypes.models import Error
|
||||
from onefuzztypes.models import Task as BASE_TASK
|
||||
from onefuzztypes.models import TaskConfig, TaskVm, UserInfo
|
||||
from onefuzztypes.primitives import PoolName
|
||||
|
||||
from ..azure.image import get_os
|
||||
from ..azure.queue import create_queue, delete_queue
|
||||
@ -165,7 +166,7 @@ class Task(BASE_TASK, ORMMixin):
|
||||
return task
|
||||
|
||||
@classmethod
|
||||
def get_tasks_by_pool_name(cls, pool_name: str) -> List["Task"]:
|
||||
def get_tasks_by_pool_name(cls, pool_name: PoolName) -> List["Task"]:
|
||||
tasks = cls.search_states(states=TaskState.available())
|
||||
if not tasks:
|
||||
return []
|
||||
|
Reference in New Issue
Block a user