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.creds import get_instance_id
|
||||||
from ..azure.queue import get_queue_sas
|
from ..azure.queue import get_queue_sas
|
||||||
from ..azure.storage import StorageType
|
from ..azure.storage import StorageType
|
||||||
|
from ..workers.pools import Pool
|
||||||
from .defs import TASK_DEFINITIONS
|
from .defs import TASK_DEFINITIONS
|
||||||
|
|
||||||
LOGGER = logging.getLogger("onefuzz")
|
LOGGER = logging.getLogger("onefuzz")
|
||||||
@ -143,25 +144,24 @@ def check_config(config: TaskConfig) -> None:
|
|||||||
raise TaskConfigError("missing supervisor_exe")
|
raise TaskConfigError("missing supervisor_exe")
|
||||||
|
|
||||||
if config.vm:
|
if config.vm:
|
||||||
if not check_val(definition.vm.compare, definition.vm.value, config.vm.count):
|
err = "specifying task config vm is no longer supported"
|
||||||
err = "invalid vm count: expected %s %d, got %s" % (
|
raise TaskConfigError(err)
|
||||||
definition.vm.compare,
|
|
||||||
definition.vm.value,
|
if not config.pool:
|
||||||
config.vm.count,
|
raise TaskConfigError("pool must be specified")
|
||||||
)
|
|
||||||
LOGGER.error(err)
|
if not check_val(definition.vm.compare, definition.vm.value, config.pool.count):
|
||||||
raise TaskConfigError(err)
|
err = "invalid vm count: expected %s %d, got %s" % (
|
||||||
elif config.pool:
|
definition.vm.compare,
|
||||||
if not check_val(definition.vm.compare, definition.vm.value, config.pool.count):
|
definition.vm.value,
|
||||||
err = "invalid vm count: expected %s %d, got %s" % (
|
config.pool.count,
|
||||||
definition.vm.compare,
|
)
|
||||||
definition.vm.value,
|
LOGGER.error(err)
|
||||||
config.pool.count,
|
raise TaskConfigError(err)
|
||||||
)
|
|
||||||
LOGGER.error(err)
|
pool = Pool.get_by_name(config.pool.pool_name)
|
||||||
raise TaskConfigError(err)
|
if not isinstance(pool, Pool):
|
||||||
else:
|
raise TaskConfigError(f"invalid pool: {config.pool.pool_name}")
|
||||||
raise TaskConfigError("either the vm or pool must be specified")
|
|
||||||
|
|
||||||
check_target_exe(config, definition)
|
check_target_exe(config, definition)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user