[ARVADOS] updated: 6362c17d947b16db1e2b71f7a06da9c930ef9778

Git user git at public.curoverse.com
Fri Oct 21 10:17:21 EDT 2016


Summary of changes:
 services/api/app/models/container.rb             | 8 ++++----
 services/api/test/unit/container_request_test.rb | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

       via  6362c17d947b16db1e2b71f7a06da9c930ef9778 (commit)
      from  9290528fb9700db4541ebe29c94eda3503f509f4 (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 6362c17d947b16db1e2b71f7a06da9c930ef9778
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri Oct 21 08:47:05 2016 -0400

    10172: Fix container request test.  Replace
    Thread.current[:api_client_authorization] with
    current_api_client_authorization.

diff --git a/services/api/app/models/container.rb b/services/api/app/models/container.rb
index a3057d6..ac2708c 100644
--- a/services/api/app/models/container.rb
+++ b/services/api/app/models/container.rb
@@ -191,15 +191,15 @@ class Container < ArvadosModel
     # output (only).  Whether it is legal to set progress and output in the current
     # state has already been checked in validate_change.
     current_user.andand.is_admin ||
-      (!Thread.current[:api_client_authorization].nil? and
-       [self.auth_uuid, self.locked_by_uuid].include? Thread.current[:api_client_authorization].uuid)
+      (!current_api_client_authorization.nil? and
+       [self.auth_uuid, self.locked_by_uuid].include? current_api_client_authorization.uuid)
   end
 
   def ensure_owner_uuid_is_permitted
     # Override base permission check to allow auth_uuid to set progress and
     # output (only).  Whether it is legal to set progress and output in the current
     # state has already been checked in validate_change.
-    if !Thread.current[:api_client_authorization].nil? and self.auth_uuid == Thread.current[:api_client_authorization].uuid
+    if !current_api_client_authorization.nil? and self.auth_uuid == current_api_client_authorization.uuid
       check_update_whitelist [:progress, :output]
     else
       super
@@ -260,7 +260,7 @@ class Container < ArvadosModel
     if [Locked, Running].include? self.state
       # If the Container was already locked, locked_by_uuid must not
       # changes. Otherwise, the current auth gets the lock.
-      need_lock = locked_by_uuid_was || Thread.current[:api_client_authorization].andand.uuid
+      need_lock = locked_by_uuid_was || current_api_client_authorization.andand.uuid
     else
       need_lock = nil
     end
diff --git a/services/api/test/unit/container_request_test.rb b/services/api/test/unit/container_request_test.rb
index ecfbe46..406bb42 100644
--- a/services/api/test/unit/container_request_test.rb
+++ b/services/api/test/unit/container_request_test.rb
@@ -276,7 +276,7 @@ class ContainerRequestTest < ActiveSupport::TestCase
   end
 
   [
-    ['active', 'zzzzz-dz642-runningcontainr'],
+    ['running_container_auth', 'zzzzz-dz642-runningcontainr'],
     ['active_no_prefs', nil],
   ].each do |token, expected|
     test "create as #{token} and expect requesting_container_uuid to be #{expected}" do

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list