11948: if -> elif style fix
[arvados.git] / sdk / cwl / arvados_cwl / arvdocker.py
index f83add9379c176d5cb9ad472c0778c68174058b5..f42e6d8c9c356cfcee7c165d554359cdec40623b 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
 import logging
 import sys
 import threading
@@ -27,7 +31,7 @@ def arv_docker_get_image(api_client, dockerRequirement, pull_image, project_uuid
     global cached_lookups_lock
     with cached_lookups_lock:
         if dockerRequirement["dockerImageId"] in cached_lookups:
-            return cached_lookups[dockerRequirement["dockerImageId"]]
+            return dockerRequirement["dockerImageId"]
 
     with SourceLine(dockerRequirement, "dockerImageId", WorkflowException):
         sp = dockerRequirement["dockerImageId"].split(":")
@@ -63,12 +67,10 @@ def arv_docker_get_image(api_client, dockerRequirement, pull_image, project_uuid
         if not images:
             raise WorkflowException("Could not find Docker image %s:%s" % (image_name, image_tag))
 
-        pdh = api_client.collections().get(uuid=images[0][0]).execute()["portable_data_hash"]
-
         with cached_lookups_lock:
-            cached_lookups[dockerRequirement["dockerImageId"]] = pdh
+            cached_lookups[dockerRequirement["dockerImageId"]] = True
 
-        return pdh
+    return dockerRequirement["dockerImageId"]
 
 def arv_docker_clear_cache():
     global cached_lookups