[ARVADOS] updated: ac4facb25d9c5828c247ada1fa7618c5a2e8b2d8

git at public.curoverse.com git at public.curoverse.com
Sun Mar 16 15:54:49 EDT 2014


Summary of changes:
 .../api/app/controllers/application_controller.rb  |   55 +++++++++-
 .../app/controllers/arvados/v1/jobs_controller.rb  |    1 +
 .../controllers/arvados/v1/schema_controller.rb    |    7 +-
 .../app/controllers/arvados/v1/users_controller.rb |   43 ++++---
 services/api/app/models/arvados_model.rb           |    6 +-
 services/api/config/application.default.yml        |    2 +-
 services/api/config/application.yml.example        |    9 +-
 .../functional/arvados/v1/jobs_controller_test.rb  |  123 ++++++++++++++++++++
 .../arvados/v1/keep_disks_controller_test.rb       |   28 +++++
 9 files changed, 247 insertions(+), 27 deletions(-)

       via  ac4facb25d9c5828c247ada1fa7618c5a2e8b2d8 (commit)
       via  dcbb5acc0f9767c6b358e5f5d6055b78290430ab (commit)
       via  10e70461bf3cb8c6ff859ce8313629a56783ba34 (commit)
       via  2f617987819f35c3b8ef7f3c6527d3772f8f5b76 (commit)
       via  a2de166ab578fcad18a3a27ff58f134af03b8275 (commit)
       via  1dec6cc7093bcc565bed2baba17c8a892b7e2633 (commit)
       via  35336cd73e444534cb2eda20e3730464cc4e6553 (commit)
       via  63e8f77e963949d4187555411e7b5c60fc850468 (commit)
       via  d7b51d23da327117fd94ad32d6be791cf50cbc11 (commit)
       via  4c159c650b13a8627c216712b71817fc9bcb7c62 (commit)
      from  daf4ff30727f49ee3606fe8adab3b67f35e00beb (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 ac4facb25d9c5828c247ada1fa7618c5a2e8b2d8
Author: radhika chippada <radhika at radhika.curoverse>
Date:   Sun Mar 16 15:54:11 2014 -0400

    More accomplished

diff --git a/services/api/app/controllers/arvados/v1/users_controller.rb b/services/api/app/controllers/arvados/v1/users_controller.rb
index d87e51d..c5ca422 100644
--- a/services/api/app/controllers/arvados/v1/users_controller.rb
+++ b/services/api/app/controllers/arvados/v1/users_controller.rb
@@ -85,24 +85,27 @@ class Arvados::V1::UsersController < ApplicationController
         end
       end
     end
+
+		@object = User.find @object[:uuid]
     show
   end
 
 	# create user object and all the needed links
   def create
+		# check if default openid_prefix needs to be overridden
 		openid_prefix = 'https://www.google.com/accounts/o8/id'		# default openid prefix
-		if params[openid_prefix]
-			openid_prefix = params[openid_prefix]
+		if params[:openid_prefix]
+			openid_prefix = params[:openid_prefix]
 		end
 		login_perm_props = {identity_url_prefix: openid_prefix}
 
-puts "\n*******************************\nparams = #{params}"
-puts "\n*******************************\nlogin_perm_props = #{login_perm_props.inspect}"
+		# check if only to probe the given user parameter
+		just_probe = params[:just_probe]
 
  		@object = model_class.new resource_attrs
-  	need_to_create = false
 
 		# If user_param parameter is passed, lookup for user. If exists, skip create and create any missing links. 
+  	need_to_create = false
 		if params[:user_param]
 			begin 
 	 			@object_found = find_user_from_user_param params[:user_param]
@@ -119,9 +122,17 @@ puts "\n*******************************\nlogin_perm_props = #{login_perm_props.i
 		else		# need to create user for the given :user data
 			need_to_create = true
 		end
-	
-		if need_to_create
+
+		# if just probing, return any object found	
+		if just_probe == true 	
+			show
+			return
+		end
+
+		# create if need be, and then create or update the links as needed 
+		if need_to_create == true
 			if @object.save
+
 				# create openid login permission
 	      oid_login_perm = Link.create(link_class: 'permission',
 	                                   name: 'can_login',
@@ -142,12 +153,13 @@ puts "\n*******************************\nlogin_perm_props = #{login_perm_props.i
 		link_repo params[:repo_name]
 		vm_login_permission params[:vm_uuid]
 		link_group 
-puts "@object in the end #{@object.inspect}"
+
 		show
   end
 
 	protected 
 
+	# find the user from the given user parameter
 	def find_user_from_user_param(user_param)
 		found_object = User.find_by_uuid user_param
 		puts "found by uuid = #{found_object.inspect}"
@@ -173,11 +185,8 @@ puts "@object in the end #{@object.inspect}"
 		return found_object
 	end
 	
+	# link the repo_name passed
 	def link_repo(repo_name)
-		puts "\n*******************************\n"
-		puts "repo_name = #{repo_name}"
-		puts "and object is #{@object[:uuid]}"	
-
 		if !repo_name
 			logger.warn ("Repository name not given for #{@object[:uuid]}. Skip creating the link")
 			return
@@ -213,11 +222,8 @@ puts "@object in the end #{@object.inspect}"
 		logger.info { "repo permission: " + repo_perm[:uuid] }
 	end
 
+	# create login permission for the given vm_uuid
 	def vm_login_permission(vm_uuid)
-		puts "\n*******************************\n"
-		puts "vm_uuid = #{vm_uuid}"
-		puts "and object is #{@object[:uuid]}"		
-
 		# Look up the given virtual machine just to make sure it really exists.
 		begin
   		vm = VirtualMachine.get(uuid: vm_uuid)
@@ -236,11 +242,8 @@ puts "@object in the end #{@object.inspect}"
 		end
 	end
 
+	# add the user to the 'All users' group
 	def link_group
-		puts "\n*******************************\n"
-		puts "in link group" 
-		puts "and object is #{@object[:uuid]}"	
-
 		# Look up the "All users" group (we expect uuid *-*-fffffffffffffff).
 		group = Group.where(name: 'All users').select do |g|
 			g[:uuid].match /-f+$/

commit dcbb5acc0f9767c6b358e5f5d6055b78290430ab
Merge: daf4ff3 10e7046
Author: radhika chippada <radhika at radhika.curoverse>
Date:   Sat Mar 15 22:15:04 2014 -0400

    Merge branch 'master' into 2187-enhance-user-setup


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


hooks/post-receive
-- 




More information about the arvados-commits mailing list