[ARVADOS] updated: 1.3.0-1591-g91bee39e7

Git user git at public.curoverse.com
Tue Sep 10 15:28:13 UTC 2019


Summary of changes:
 services/api/app/models/container_request.rb | 30 +++++++++++++++-------------
 1 file changed, 16 insertions(+), 14 deletions(-)

       via  91bee39e7e5bcba0d5e418b532fc34949ffbefa8 (commit)
      from  6b43b14a374f217ddf5870c2ed9cd90152d8e6e2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 91bee39e7e5bcba0d5e418b532fc34949ffbefa8
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Tue Sep 10 11:25:58 2019 -0400

    15499: Only create additional log collection when container is Complete
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/services/api/app/models/container_request.rb b/services/api/app/models/container_request.rb
index 7aa82335f..5a7818147 100644
--- a/services/api/app/models/container_request.rb
+++ b/services/api/app/models/container_request.rb
@@ -156,20 +156,22 @@ class ContainerRequest < ArvadosModel
     container = Container.find_by_uuid(container_uuid)
     update_collections(container: container)
 
-    log_col = Collection.where(portable_data_hash: container.log).first
-    if log_col
-      # Need to save collection
-      completed_coll = Collection.new(
-        owner_uuid: self.owner_uuid,
-        name: "Container log for container #{container_uuid}",
-        properties: {
-          'type' => 'log',
-          'container_request' => self.uuid,
-          'container_uuid' => container_uuid,
-        },
-        portable_data_hash: log_col.portable_data_hash,
-        manifest_text: log_col.manifest_text)
-      completed_coll.save_with_unique_name!
+    if container.state == Container::Complete
+      log_col = Collection.where(portable_data_hash: container.log).first
+      if log_col
+        # Need to save collection
+        completed_coll = Collection.new(
+          owner_uuid: self.owner_uuid,
+          name: "Container log for container #{container_uuid}",
+          properties: {
+            'type' => 'log',
+            'container_request' => self.uuid,
+            'container_uuid' => container_uuid,
+          },
+          portable_data_hash: log_col.portable_data_hash,
+          manifest_text: log_col.manifest_text)
+        completed_coll.save_with_unique_name!
+      end
     end
 
     update_attributes!(state: Final)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list