[ARVADOS] updated: 49d953403625ca145081f9ccd914e70d49e51d49
git at public.curoverse.com
git at public.curoverse.com
Wed May 21 14:29:44 EDT 2014
Summary of changes:
apps/workbench/app/views/layouts/application.html.erb | 8 ++++----
doc/api/methods/keep_services.html.textile.liquid | 4 ++--
.../app/controllers/arvados/v1/keep_services_controller.rb | 10 +++-------
services/api/app/models/keep_disk.rb | 12 +++---------
services/api/config/routes.rb | 2 +-
services/api/test/fixtures/links.yml | 14 ++++++++++++++
.../functional/arvados/v1/keep_disks_controller_test.rb | 4 ++++
services/api/test/integration/keep_proxy_test.rb | 4 ++--
8 files changed, 33 insertions(+), 25 deletions(-)
via 49d953403625ca145081f9ccd914e70d49e51d49 (commit)
from 040f1c94dfa1a53356d24e77afdbc0f2e5cfe91c (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 49d953403625ca145081f9ccd914e70d49e51d49
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Wed May 21 14:29:40 2014 -0400
2776: Fixed misspelled accessable->accessible. Thanks Brett! Tweaked
workbench icons for keep services and compute nodes. Removed spurious print
statements. Tighted up definitions of service_host, service_port and
service_ssl_flag in keep_disk model.
diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index 650b9f1..660d2dc 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -128,14 +128,14 @@
<i class="fa fa-lg fa-users fa-fw"></i> Groups
</a></li>
<li><a href="/nodes">
- <i class="fa fa-lg fa-cogs fa-fw"></i> Compute nodes
+ <i class="fa fa-lg fa-cloud fa-fw"></i> Compute nodes
+ </a></li>
+ <li><a href="/keep_services">
+ <i class="fa fa-lg fa-exchange fa-fw"></i> Keep services
</a></li>
<li><a href="/keep_disks">
<i class="fa fa-lg fa-hdd-o fa-fw"></i> Keep disks
</a></li>
- <li><a href="/keep_services">
- <i class="fa fa-lg fa-hdd-o fa-fw"></i> Keep services
- </a></li>
</ul>
<% end %>
diff --git a/doc/api/methods/keep_services.html.textile.liquid b/doc/api/methods/keep_services.html.textile.liquid
index 321dd15..da6818b 100644
--- a/doc/api/methods/keep_services.html.textile.liquid
+++ b/doc/api/methods/keep_services.html.textile.liquid
@@ -12,9 +12,9 @@ API endpoint base: @https://{{ site.arvados_api_host }}/arvados/v1/keep_services
Required arguments are displayed in %{background:#ccffcc}green%.
-h2. accessable
+h2. accessible
-Get a list of keep services that are accessable to the requesting client. This
+Get a list of keep services that are accessible to the requesting client. This
is context-sensitive, for example providing the list of actual Keep servers
when inside the cluster, but providing a proxy service if client contacts
Arvados from outside the cluster.
diff --git a/services/api/app/controllers/arvados/v1/keep_services_controller.rb b/services/api/app/controllers/arvados/v1/keep_services_controller.rb
index 8c7ae7a..2cb68fd 100644
--- a/services/api/app/controllers/arvados/v1/keep_services_controller.rb
+++ b/services/api/app/controllers/arvados/v1/keep_services_controller.rb
@@ -1,7 +1,7 @@
class Arvados::V1::KeepServicesController < ApplicationController
- skip_before_filter :find_object_by_uuid, only: :accessable
- skip_before_filter :render_404_if_no_object, only: :accessable
+ skip_before_filter :find_object_by_uuid, only: :accessible
+ skip_before_filter :render_404_if_no_object, only: :accessible
def find_objects_for_index
# all users can list all keep services
@@ -9,16 +9,12 @@ class Arvados::V1::KeepServicesController < ApplicationController
super
end
- def accessable
- puts "Hello world"
+ def accessible
if request.headers['X-Keep-Proxy-Required']
@objects = model_class.where('service_type=?', 'proxy')
else
@objects = model_class.where('service_type=?', 'disk')
end
-
- puts "Rendering list now"
-
render_list
end
diff --git a/services/api/app/models/keep_disk.rb b/services/api/app/models/keep_disk.rb
index 04171bc..da421eb 100644
--- a/services/api/app/models/keep_disk.rb
+++ b/services/api/app/models/keep_disk.rb
@@ -48,21 +48,15 @@ class KeepDisk < ArvadosModel
end
def service_host
- KeepService.where(uuid: self.keep_service_uuid).each do |k|
- return k.service_host
- end
+ KeepService.find_by_uuid(self.keep_service_uuid).andand.service_host
end
def service_port
- KeepService.where(uuid: self.keep_service_uuid).each do |k|
- return k.service_port
- end
+ KeepService.find_by_uuid(self.keep_service_uuid).andand.service_port
end
def service_ssl_flag
- KeepService.where(uuid: self.keep_service_uuid).each do |k|
- return k.service_ssl_flag
- end
+ KeepService.find_by_uuid(self.keep_service_uuid).andand.service_ssl_flag
end
protected
diff --git a/services/api/config/routes.rb b/services/api/config/routes.rb
index c1549d0..0223c04 100644
--- a/services/api/config/routes.rb
+++ b/services/api/config/routes.rb
@@ -28,7 +28,7 @@ Server::Application.routes.draw do
post 'ping', on: :collection
end
resources :keep_services do
- get 'accessable', on: :collection
+ get 'accessible', on: :collection
end
resources :links
resources :logs
diff --git a/services/api/test/fixtures/links.yml b/services/api/test/fixtures/links.yml
index ba6e83e..a7821aa 100644
--- a/services/api/test/fixtures/links.yml
+++ b/services/api/test/fixtures/links.yml
@@ -389,3 +389,17 @@ active_user_can_manage_bad_group_cx2al9cqkmsf1hs:
name: can_manage
head_uuid: zzzzz-j7d0g-cx2al9cqkmsf1hs
properties: {}
+
+multilevel_collection_1_readable_by_active:
+ uuid: zzzzz-o0j2j-dp1d8395ldqw22j
+ owner_uuid: zzzzz-tpzed-000000000000000
+ created_at: 2014-01-24 20:42:26 -0800
+ modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
+ modified_by_user_uuid: zzzzz-tpzed-000000000000000
+ modified_at: 2014-01-24 20:42:26 -0800
+ updated_at: 2014-01-24 20:42:26 -0800
+ tail_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+ link_class: permission
+ name: can_read
+ head_uuid: 1fd08fc162a5c6413070a8bd0bffc818+150
+ properties: {}
diff --git a/services/api/test/functional/arvados/v1/keep_disks_controller_test.rb b/services/api/test/functional/arvados/v1/keep_disks_controller_test.rb
index 5f1402e..a41531a 100644
--- a/services/api/test/functional/arvados/v1/keep_disks_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/keep_disks_controller_test.rb
@@ -67,6 +67,10 @@ class Arvados::V1::KeepDisksControllerTest < ActionController::TestCase
assert_response :success
items = JSON.parse(@response.body)['items']
assert_not_equal 0, items.size
+
+ # Check these are still included
+ assert items[0]['service_host']
+ assert items[0]['service_port']
end
# active user sees non-secret attributes of keep disks
diff --git a/services/api/test/integration/keep_proxy_test.rb b/services/api/test/integration/keep_proxy_test.rb
index 130b252..347f69d 100644
--- a/services/api/test/integration/keep_proxy_test.rb
+++ b/services/api/test/integration/keep_proxy_test.rb
@@ -2,7 +2,7 @@ require 'test_helper'
class KeepProxyTest < ActionDispatch::IntegrationTest
test "request keep disks" do
- get "/arvados/v1/keep_services/accessable", {:format => :json}, auth(:active)
+ get "/arvados/v1/keep_services/accessible", {:format => :json}, auth(:active)
assert_response :success
services = json_response['items']
@@ -10,7 +10,7 @@ class KeepProxyTest < ActionDispatch::IntegrationTest
assert_equal 'disk', services[0]['service_type']
assert_equal 'disk', services[1]['service_type']
- get "/arvados/v1/keep_services/accessable", {:format => :json}, auth(:active).merge({'HTTP_X_KEEP_PROXY_REQUIRED' => true})
+ get "/arvados/v1/keep_services/accessible", {:format => :json}, auth(:active).merge({'HTTP_X_KEEP_PROXY_REQUIRED' => true})
assert_response :success
services = json_response['items']
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list