Airavata 0.15.0 current git pull

Comment: I believe you want to check if the data movement protocol is null not the job submission protocol before setting the data movement protocol. Also, the .get(0) will throw an NPE if you don't check that the getHostPrioritizedDataMovementInterfaces() has at least one element (in this case I'm checking for not null && not empty). Likely, similar code should be applied to the previous .get(0) in the job submission protocol previous to this block.

--- BetterGfacImpl.java~        2015-10-28 12:39:17.586646368 -0500
+++ BetterGfacImpl.java 2015-10-29 15:01:48.300713817 -0500
@@ -345,7 +345,7 @@

// set gatewayUserPreferred data movement protocol and interface
jobExecutionContext.setPreferredDataMovementProtocol(gatewayResourcePreferences.getPreferredDataMovementProtocol());
- if (gatewayResourcePreferences.getPreferredJobSubmissionProtocol() == null) { + if (gatewayResourcePreferences.getPreferredDataMovementProtocol() == null && jobExecutionContext.getHostPrioritizedDataMovementInterfaces() != null && !jobExecutionContext.getHostPrioritizedDataMovementInterfaces().isEmpty() ) {
jobExecutionContext.setPreferredDataMovementInterface(jobExecutionContext.getHostPrioritizedDataMovementInterfaces().get(0));
if (jobExecutionContext.getPreferredDataMovementInterface() != null){
jobExecutionContext.setPreferredDataMovementProtocol(jobExecutionContext.getPreferredDataMovementInterface().getDataMovementProtocol());

Reply via email to