Skip to content

Commit 2b6a737

Browse files
committed
calm bandit warnings
1 parent 67ea28e commit 2b6a737

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

cwltool/docker.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
import re
77
import shutil
8-
import subprocess
8+
import subprocess # nosec
99
import sys
1010
import tempfile
1111
import threading
@@ -46,7 +46,7 @@ def _get_docker_machine_mounts() -> List[str]:
4646
else:
4747
__docker_machine_mounts = [
4848
"/" + line.split(None, 1)[0]
49-
for line in subprocess.check_output(
49+
for line in subprocess.check_output( # nosec
5050
[
5151
"docker-machine",
5252
"ssh",
@@ -129,7 +129,7 @@ def get_image(
129129
return True
130130

131131
for line in (
132-
subprocess.check_output(["docker", "images", "--no-trunc", "--all"])
132+
subprocess.check_output(["docker", "images", "--no-trunc", "--all"]) # nosec
133133
.decode("utf-8")
134134
.splitlines()
135135
):
@@ -164,7 +164,7 @@ def get_image(
164164
if "dockerPull" in docker_requirement:
165165
cmd = ["docker", "pull", str(docker_requirement["dockerPull"])]
166166
_logger.info(str(cmd))
167-
subprocess.check_call(cmd, stdout=sys.stderr)
167+
subprocess.check_call(cmd, stdout=sys.stderr) # nosec
168168
found = True
169169
elif "dockerFile" in docker_requirement:
170170
dockerfile_dir = str(tempfile.mkdtemp(prefix=tmp_outdir_prefix))
@@ -177,7 +177,7 @@ def get_image(
177177
dockerfile_dir,
178178
]
179179
_logger.info(str(cmd))
180-
subprocess.check_call(cmd, stdout=sys.stderr)
180+
subprocess.check_call(cmd, stdout=sys.stderr) # nosec
181181
found = True
182182
elif "dockerLoad" in docker_requirement:
183183
cmd = ["docker", "load"]
@@ -188,9 +188,9 @@ def get_image(
188188
docker_requirement["dockerLoad"],
189189
)
190190
with open(docker_requirement["dockerLoad"], "rb") as dload:
191-
loadproc = subprocess.Popen(cmd, stdin=dload, stdout=sys.stderr)
191+
loadproc = subprocess.Popen(cmd, stdin=dload, stdout=sys.stderr) # nosec
192192
else:
193-
loadproc = subprocess.Popen(
193+
loadproc = subprocess.Popen( # nosec
194194
cmd, stdin=subprocess.PIPE, stdout=sys.stderr
195195
)
196196
assert loadproc.stdin is not None # nosec
@@ -218,7 +218,7 @@ def get_image(
218218
str(docker_requirement["dockerImageId"]),
219219
]
220220
_logger.info(str(cmd))
221-
subprocess.check_call(cmd, stdout=sys.stderr)
221+
subprocess.check_call(cmd, stdout=sys.stderr) # nosec
222222
found = True
223223

224224
if found:

cwltool/docker_id.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Helper functions for docker."""
22

3-
import subprocess
3+
import subprocess # nosec
44
from typing import List, Optional, Tuple
55

66

@@ -30,7 +30,7 @@ def check_output_and_strip(cmd): # type: (List[str]) -> Optional[str]
3030
:return: Stripped string output of the command, or None if error
3131
"""
3232
try:
33-
result = subprocess.check_output(
33+
result = subprocess.check_output( # nosec
3434
cmd, stderr=subprocess.STDOUT, universal_newlines=True
3535
)
3636
return result.strip()

cwltool/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ def __init__(
818818
loadingContext.requirements = copy.deepcopy(
819819
getdefault(loadingContext.requirements, [])
820820
)
821-
assert loadingContext.requirements is not None
821+
assert loadingContext.requirements is not None # nosec
822822
loadingContext.requirements.extend(toolpath_object.get("requirements", []))
823823
loadingContext.requirements.extend(
824824
get_overrides(getdefault(loadingContext.overrides_list, []), self.id).get(

0 commit comments

Comments
 (0)