mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-16 20:08:09 +00:00
tasks must use pools not VMs (#1105)
using config.vm depricated prior to 1.0.0
This commit is contained in:
@ -18,6 +18,7 @@ from ..azure.containers import blob_exists, container_exists, get_container_sas_
|
||||
from ..azure.creds import get_instance_id
|
||||
from ..azure.queue import get_queue_sas
|
||||
from ..azure.storage import StorageType
|
||||
from ..workers.pools import Pool
|
||||
from .defs import TASK_DEFINITIONS
|
||||
|
||||
LOGGER = logging.getLogger("onefuzz")
|
||||
@ -143,25 +144,24 @@ def check_config(config: TaskConfig) -> None:
|
||||
raise TaskConfigError("missing supervisor_exe")
|
||||
|
||||
if config.vm:
|
||||
if not check_val(definition.vm.compare, definition.vm.value, config.vm.count):
|
||||
err = "invalid vm count: expected %s %d, got %s" % (
|
||||
definition.vm.compare,
|
||||
definition.vm.value,
|
||||
config.vm.count,
|
||||
)
|
||||
LOGGER.error(err)
|
||||
raise TaskConfigError(err)
|
||||
elif config.pool:
|
||||
if not check_val(definition.vm.compare, definition.vm.value, config.pool.count):
|
||||
err = "invalid vm count: expected %s %d, got %s" % (
|
||||
definition.vm.compare,
|
||||
definition.vm.value,
|
||||
config.pool.count,
|
||||
)
|
||||
LOGGER.error(err)
|
||||
raise TaskConfigError(err)
|
||||
else:
|
||||
raise TaskConfigError("either the vm or pool must be specified")
|
||||
err = "specifying task config vm is no longer supported"
|
||||
raise TaskConfigError(err)
|
||||
|
||||
if not config.pool:
|
||||
raise TaskConfigError("pool must be specified")
|
||||
|
||||
if not check_val(definition.vm.compare, definition.vm.value, config.pool.count):
|
||||
err = "invalid vm count: expected %s %d, got %s" % (
|
||||
definition.vm.compare,
|
||||
definition.vm.value,
|
||||
config.pool.count,
|
||||
)
|
||||
LOGGER.error(err)
|
||||
raise TaskConfigError(err)
|
||||
|
||||
pool = Pool.get_by_name(config.pool.pool_name)
|
||||
if not isinstance(pool, Pool):
|
||||
raise TaskConfigError(f"invalid pool: {config.pool.pool_name}")
|
||||
|
||||
check_target_exe(config, definition)
|
||||
|
||||
|
Reference in New Issue
Block a user