This commit is contained in:
@@ -31,6 +31,8 @@ class TaskConstraints:
|
||||
|
||||
driver_type: str | None = None
|
||||
capability_tags: list[str] = field(default_factory=list)
|
||||
target_host_id: str | None = None
|
||||
target_device_id: str | None = None
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -195,6 +197,10 @@ class TaskScheduler:
|
||||
|
||||
|
||||
def _matches(device: "PooledDevice", constraints: TaskConstraints) -> bool:
|
||||
if constraints.target_host_id and device.host_id != constraints.target_host_id:
|
||||
return False
|
||||
if constraints.target_device_id and device.device_id != constraints.target_device_id:
|
||||
return False
|
||||
if constraints.driver_type and device.driver_type != constraints.driver_type:
|
||||
return False
|
||||
if constraints.capability_tags:
|
||||
|
||||
Reference in New Issue
Block a user