Skip to content

Commit 4e6ffc0

Browse files
committed
general cleanups
1 parent b07a1fb commit 4e6ffc0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cwltool/docker.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
from .secrets import SecretStore # pylint: disable=unused-import
2323
from .utils import (DEFAULT_TMP_PREFIX, docker_windows_path_adjust, onWindows,
2424
subprocess)
25-
from .context import RuntimeContext
25+
from .context import RuntimeContext # pylint: disable=unused-import
2626

27-
found_images = set() # type: Set[Text]
28-
found_images_lock = threading.Lock()
27+
_IMAGES = set() # type: Set[Text]
28+
_IMAGES_LOCK = threading.Lock()
2929
__docker_machine_mounts = None # type: Optional[List[Text]]
3030
__docker_machine_mounts_lock = threading.Lock()
3131

@@ -91,8 +91,8 @@ def get_image(docker_requirement, # type: Dict[Text, Text]
9191
and "dockerPull" in docker_requirement:
9292
docker_requirement["dockerImageId"] = docker_requirement["dockerPull"]
9393

94-
with found_images_lock:
95-
if docker_requirement["dockerImageId"] in found_images:
94+
with _IMAGES_LOCK:
95+
if docker_requirement["dockerImageId"] in _IMAGES:
9696
return True
9797

9898
for line in subprocess.check_output(
@@ -132,7 +132,7 @@ def get_image(docker_requirement, # type: Dict[Text, Text]
132132
elif "dockerFile" in docker_requirement:
133133
dockerfile_dir = str(tempfile.mkdtemp(prefix=tmp_outdir_prefix))
134134
with open(os.path.join(
135-
dockerfile_dir, "Dockerfile"), "wb") as dfile:
135+
dockerfile_dir, "Dockerfile"), "wb") as dfile:
136136
dfile.write(docker_requirement["dockerFile"].encode('utf-8'))
137137
cmd = ["docker", "build", "--tag=%s" %
138138
str(docker_requirement["dockerImageId"]), dockerfile_dir]
@@ -171,8 +171,8 @@ def get_image(docker_requirement, # type: Dict[Text, Text]
171171
found = True
172172

173173
if found:
174-
with found_images_lock:
175-
found_images.add(docker_requirement["dockerImageId"])
174+
with _IMAGES_LOCK:
175+
_IMAGES.add(docker_requirement["dockerImageId"])
176176

177177
return found
178178

0 commit comments

Comments
 (0)