Skip to content

Commit fe28fc6

Browse files
committed
When docker is unavailable and marked as required, exit accordingly
1 parent 13084e4 commit fe28fc6

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

cwltool/job.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
from .docker_uid import docker_vm_uid
1919
from .errors import WorkflowException
2020
from .pathmapper import PathMapper
21-
from .process import get_feature, empty_subtree, stageFiles
21+
from .process import (get_feature, empty_subtree, stageFiles,
22+
UnsupportedRequirement)
2223

2324
_logger = logging.getLogger("cwltool")
2425

@@ -335,7 +336,8 @@ def run(self, pull_image=True, rm_container=True,
335336
except Exception as e:
336337
_logger.debug("Docker error", exc_info=True)
337338
if docker_is_req:
338-
raise WorkflowException("Docker is required to run this tool: %s" % e)
339+
raise UnsupportedRequirement(
340+
"Docker is required to run this tool: %s" % e)
339341
else:
340342
raise WorkflowException("Docker is not available for this tool, try --no-container to disable Docker: %s" % e)
341343

cwltool/process.py

-5
Original file line numberDiff line numberDiff line change
@@ -530,11 +530,6 @@ def _init_job(self, joborder, **kwargs):
530530
builder.mutation_manager = kwargs.get("mutation_manager")
531531

532532
dockerReq, is_req = self.get_requirement("DockerRequirement")
533-
534-
if dockerReq and is_req and not kwargs.get("use_container"):
535-
raise WorkflowException(
536-
"Document has DockerRequirement under 'requirements' but use_container is false. DockerRequirement must be under 'hints' or use_container must be true.")
537-
538533
builder.make_fs_access = kwargs.get("make_fs_access") or StdFsAccess
539534
builder.fs_access = builder.make_fs_access(kwargs["basedir"])
540535

0 commit comments

Comments
 (0)