Skip to content

Commit bd54f6d

Browse files
committed
affirm our usage of subprocess.*
1 parent 239499d commit bd54f6d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cwltool/singularity.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626

2727
if os.name == 'posix':
2828
if sys.version_info < (3, 5):
29-
from subprocess32 import ( # pylint: disable=import-error,no-name-in-module
29+
from subprocess32 import ( # nosec # pylint: disable=import-error,no-name-in-module
3030
check_call, check_output, CalledProcessError, DEVNULL, PIPE, Popen,
3131
TimeoutExpired)
3232
else:
33-
from subprocess import ( # pylint: disable=import-error,no-name-in-module
33+
from subprocess import ( # nosec # pylint: disable=import-error,no-name-in-module
3434
check_call, check_output, CalledProcessError, DEVNULL, PIPE, Popen,
3535
TimeoutExpired)
3636

@@ -44,7 +44,7 @@ def _singularity_supports_userns(): # type: ()->bool
4444
if _USERNS is None:
4545
try:
4646
hello_image = os.path.join(os.path.dirname(__file__), 'hello.simg')
47-
result = Popen(
47+
result = Popen( # nosec
4848
[u"singularity", u"exec", u"--userns", hello_image, u"true"],
4949
stderr=PIPE, stdout=DEVNULL,
5050
universal_newlines=True).communicate(timeout=60)[1]
@@ -110,7 +110,7 @@ def get_image(dockerRequirement, # type: Dict[Text, Text]
110110
str(dockerRequirement["dockerImageId"]),
111111
str(dockerRequirement["dockerPull"])]
112112
_logger.info(Text(cmd))
113-
check_call(cmd, stdout=sys.stderr)
113+
check_call(cmd, stdout=sys.stderr) # nosec
114114
found = True
115115
elif "dockerFile" in dockerRequirement:
116116
raise WorkflowException(SourceLine(

cwltool/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
# no imports from cwltool allowed
2525
if os.name == 'posix':
2626
if sys.version_info < (3, 5):
27-
import subprocess32 as subprocess # pylint: disable=unused-import
27+
import subprocess32 as subprocess # nosec # pylint: disable=unused-import
2828
else:
29-
import subprocess # pylint: disable=unused-import
29+
import subprocess # nosec # pylint: disable=unused-import
3030
else:
31-
import subprocess # type: ignore
31+
import subprocess # type: ignore # nosec
3232

3333
windows_default_container_id = "frolvlad/alpine-bash"
3434

0 commit comments

Comments
 (0)