From 375c23fa047e5fcd09e71f5c473dbd05cbe14891 Mon Sep 17 00:00:00 2001 From: radhika chippada Date: Wed, 19 Mar 2014 16:32:58 -0400 Subject: [PATCH] Remove -n aka just probe option from the setup-new-user script as per Ward's core review recommendation. --- .../controllers/arvados/v1/users_controller.rb | 9 --------- services/api/script/setup-new-user.rb | 3 +-- .../arvados/v1/users_controller_test.rb | 16 ---------------- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/services/api/app/controllers/arvados/v1/users_controller.rb b/services/api/app/controllers/arvados/v1/users_controller.rb index e07d503da1..303e6d785a 100644 --- a/services/api/app/controllers/arvados/v1/users_controller.rb +++ b/services/api/app/controllers/arvados/v1/users_controller.rb @@ -97,9 +97,6 @@ class Arvados::V1::UsersController < ApplicationController end login_perm_props = {identity_url_prefix: openid_prefix} - # check if only to probe the given user parameter - just_probe = (params[:just_probe] == 'true') ? true : false; - @object = model_class.new resource_attrs # If user_param is passed, lookup for user. If exists, skip create and only create any missing links. @@ -123,12 +120,6 @@ class Arvados::V1::UsersController < ApplicationController end end - # if just probing, return any object found - if just_probe - show - return - end - # create if need be, and then create or update the links as needed if need_to_create if @object.save diff --git a/services/api/script/setup-new-user.rb b/services/api/script/setup-new-user.rb index 8462a50430..72e18040a5 100755 --- a/services/api/script/setup-new-user.rb +++ b/services/api/script/setup-new-user.rb @@ -24,7 +24,6 @@ If creating a new user record, require authentication from an OpenID \ with this OpenID prefix *and* a matching email address in order to \ claim the account. eos - opt :n, 'Do not change anything, just probe' end log.level = (ENV['DEBUG'] || opts.debug) ? Logger::DEBUG : Logger::WARN @@ -38,7 +37,7 @@ require 'arvados' arv = Arvados.new(api_version: 'v1') begin - new_user = arv.user.create(user_param: user_arg, repo_name: user_repo_name, vm_uuid: vm_uuid, openid_prefix: opts.openid_prefix, just_probe: opts.n, user: {}) + new_user = arv.user.create(user_param: user_arg, repo_name: user_repo_name, vm_uuid: vm_uuid, openid_prefix: opts.openid_prefix, user: {}) log.warn new_user rescue Exception => e #Arvados::TransactionFailedError log.warn e.message diff --git a/services/api/test/functional/arvados/v1/users_controller_test.rb b/services/api/test/functional/arvados/v1/users_controller_test.rb index 1ea549486c..a7bdb7cb10 100644 --- a/services/api/test/functional/arvados/v1/users_controller_test.rb +++ b/services/api/test/functional/arvados/v1/users_controller_test.rb @@ -182,22 +182,6 @@ class Arvados::V1::UsersControllerTest < ActionController::TestCase assert_nil response_object['first_name'], 'expecting no first name since it will be reset when user_param is used' end - test "create user with valid email user_param, vm and repo as input with opt.n" do - authorize_with :admin - - post :create, { - user_param: 'abc@xyz.com', - repo_name: 'test_repo', - vm_uuid: 'no_such_vm', - just_probe: 'true', - user: {} - } - - assert_response :success - response_object = JSON.parse(@response.body) - assert_nil response_object['uuid'], 'expected null uuid since no object created due to just probe' - end - test "create user twice with user param and check links are not recreated" do authorize_with :admin -- 2.30.2