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

Commit

Permalink
Block job submission on non-active pools
Browse files Browse the repository at this point in the history
- Resolves #251
  • Loading branch information
alfpark committed Jan 10, 2019
1 parent 1a3a6eb commit f53eee7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion convoy/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4680,13 +4680,13 @@ def add_jobs(
raise RuntimeError(
'cannot tail task output for the specified file within '
'a federation')
# get the pool inter-node comm setting
bs = settings.batch_shipyard_settings(config)
pool = settings.pool_settings(config)
native = settings.is_native_docker_pool(
config, vm_config=pool.vm_configuration)
is_windows = settings.is_windows_pool(
config, vm_config=pool.vm_configuration)
# check pool validity
try:
cloud_pool = batch_client.pool.get(pool.id)
except batchmodels.BatchErrorException as ex:
Expand All @@ -4703,6 +4703,14 @@ def add_jobs(
return
else:
raise
if (autopool is None and cloud_pool is not None and
util.is_none_or_empty(federation_id) and
cloud_pool.state != batchmodels.PoolState.active):
logger.error(
'Cannot submit jobs to pool {} which is not in active '
'state'.format(pool.id))
return
# pre-process jobs and tasks
tempdisk = settings.temp_disk_mountpoint(config)
docker_images = settings.global_resources_docker_images(config)
singularity_images = settings.global_resources_singularity_images(config)
Expand Down

0 comments on commit f53eee7

Please sign in to comment.