Skip to content

Commit ddcff63

Browse files
committed
Userkey DP error message when launching tasks.
If the user tries to launch a task on a Bourreau using files on a Userkey DP, the launch interface will tell the user if the key for the DP has not yet been pushed to the Bourreau.
1 parent 2d2fd96 commit ddcff63

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

BrainPortal/app/controllers/tasks_controller.rb

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,24 @@ def new #:nodoc:
255255
! dp.rr_allowed_syncing?(@task.bourreau)
256256
end
257257
if bad_dps.present?
258-
flash[:error] =
258+
bad_dp_report = # this report should be made into a view code partial or something, this code is ugly
259259
"Some selected files are stored on Data Providers that are\n" +
260-
"not accessible from execution server #{@task.bourreau.name}:\n\n" +
261-
(bad_dps.map do |dp|
262-
num_files = @files.count { |f| f.data_provider_id == dp.id }
260+
"not accessible from execution server #{@task.bourreau.name}:\n\n"
261+
bad_dps.each do |dp|
262+
num_files = @files.count { |f| f.data_provider_id == dp.id }
263+
bad_dp_report +=
263264
"Data Provider '#{dp.name}' : #{view_pluralize(num_files, "file")}\n"
264-
end).join
265+
end
266+
bad_dps.select { |dp|
267+
dp.is_a?(UserkeyFlatDirSshDataProvider) &&
268+
dp.user.get_ssh_key_install_date(@task.bourreau_id).blank?
269+
}.each { |dp|
270+
bad_dp_report +=
271+
"\nNote: DataProvider '#{dp.name}' is a private SSH belonging to user '#{dp.user.login}',\n" +
272+
"but that user has not yet pushed the key to the Execution Server.\n" +
273+
"This is performed in the user's 'MyAccount' page.\n"
274+
}
275+
flash[:error] = bad_dp_report
265276
redirect_to :controller => :userfiles, :action => :index
266277
return
267278
end

0 commit comments

Comments
 (0)