[ARVADOS] updated: 8bd2381e50d3c575cef3bc0f0d4c10a9bafaf292

git at public.curoverse.com git at public.curoverse.com
Sat Apr 19 23:23:44 EDT 2014


Summary of changes:
 services/api/app/models/arvados_model.rb           |   19 +++++++++++++++----
 services/api/app/models/job.rb                     |    6 +++++-
 .../functional/arvados/v1/jobs_controller_test.rb  |    2 +-
 3 files changed, 21 insertions(+), 6 deletions(-)

       via  8bd2381e50d3c575cef3bc0f0d4c10a9bafaf292 (commit)
      from  8d6efcbfb559e377a8f21873b736390035bc44ed (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 8bd2381e50d3c575cef3bc0f0d4c10a9bafaf292
Author: Tom Clegg <tom at curoverse.com>
Date:   Sat Apr 19 23:14:24 2014 -0400

    Fix failing test in 8d6efcbfb559e377a8f21873b736390035bc44ed.

diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb
index 20b2606..25d7317 100644
--- a/services/api/app/models/arvados_model.rb
+++ b/services/api/app/models/arvados_model.rb
@@ -185,6 +185,10 @@ class ArvadosModel < ActiveRecord::Base
     %w(modified_by_client_uuid)
   end
 
+  def skip_uuid_existence_check
+    []
+  end
+
   def normalize_collection_uuids
     foreign_key_attributes.each do |attr|
       attr_value = send attr
@@ -223,11 +227,18 @@ class ArvadosModel < ActiveRecord::Base
 
     foreign_key_attributes.each do |attr|
       if new_record? or send (attr + "_changed?")
+        next if skip_uuid_existence_check.include? attr
         attr_value = send attr
-        r = ArvadosModel::resource_class_for_uuid attr_value if attr_value
-        r = r.readable_by(current_user) if r and not skip_uuid_read_permission_check.include? attr
-        if r and r.where(uuid: attr_value).count == 0 and not specials.include? attr_value
-          errors.add(attr, "'#{attr_value}' not found")
+        next if specials.include? attr_value
+        if attr_value
+          if (r = ArvadosModel::resource_class_for_uuid attr_value)
+            unless skip_uuid_read_permission_check.include? attr
+              r = r.readable_by(current_user)
+            end
+            if r.where(uuid: attr_value).count == 0
+              errors.add(attr, "'#{attr_value}' not found")
+            end
+          end
         end
       end
     end
diff --git a/services/api/app/models/job.rb b/services/api/app/models/job.rb
index 61aa7dc..d3c3b1d 100644
--- a/services/api/app/models/job.rb
+++ b/services/api/app/models/job.rb
@@ -71,7 +71,11 @@ class Job < ArvadosModel
   end
 
   def skip_uuid_read_permission_check
-    super + %w(cancelled_by_client_uuid output log)
+    super + %w(cancelled_by_client_uuid)
+  end
+
+  def skip_uuid_existence_check
+    super + %w(output log)
   end
 
   def ensure_script_version_is_commit
diff --git a/services/api/test/functional/arvados/v1/jobs_controller_test.rb b/services/api/test/functional/arvados/v1/jobs_controller_test.rb
index 398c867..af8f729 100644
--- a/services/api/test/functional/arvados/v1/jobs_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/jobs_controller_test.rb
@@ -240,7 +240,7 @@ class Arvados::V1::JobsControllerTest < ActionController::TestCase
     put :update, {
       id: jobs(:nearly_finished_job).uuid,
       job: {
-        output_uuid: '551392cc37a317abf865b95f66f4ef94+101',
+        output: '551392cc37a317abf865b95f66f4ef94+101',
         log: '9215de2a951a721f5f156bc08cf63ad7+93',
         tasks_summary: {done: 1, running: 0, todo: 0, failed: 0},
         success: true,

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list