Merge branch 'master' into 10231-keep-cache-runtime-constraints
[arvados.git] / sdk / cwl / arvados_cwl / arvcontainer.py
index ed843477449554612597a1b6d1d6e6d0da4523fb..c2029b965b4f3b5173bcd981a67ff8bf3c809d3d 100644 (file)
@@ -113,10 +113,14 @@ class ArvadosContainer(object):
 
             self.arvrunner.processes[response["container_uuid"]] = self
 
-            logger.info("Container %s (%s) request state is %s", self.name, response["uuid"], response["state"])
+            container = self.arvrunner.api.containers().get(
+                uuid=response["container_uuid"]
+            ).execute(num_retries=self.arvrunner.num_retries)
+
+            logger.info("Container request %s (%s) state is %s with container %s %s", self.name, response["uuid"], response["state"], container["uuid"], container["state"])
 
-            if response["state"] == "Final":
-                self.done(response)
+            if container["state"] in ("Complete", "Cancelled"):
+                self.done(container)
         except Exception as e:
             logger.error("Got error %s" % str(e))
             self.output_callback({}, "permanentFail")