You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2016/01/28 17:58:09 UTC

airavata git commit: set paths from storage resource before setting the destination path

Repository: airavata
Updated Branches:
  refs/heads/develop 819c5e286 -> b5d568d7d


set paths from storage resource before setting the destination path


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/b5d568d7
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/b5d568d7
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/b5d568d7

Branch: refs/heads/develop
Commit: b5d568d7dc0ab393d66300610f2c6f9c9ce2ae69
Parents: 819c5e2
Author: Chathuri Wimalasena <ch...@apache.org>
Authored: Thu Jan 28 11:59:42 2016 -0500
Committer: Chathuri Wimalasena <ch...@apache.org>
Committed: Thu Jan 28 11:59:42 2016 -0500

----------------------------------------------------------------------
 .../gfac/impl/task/SCPDataStageTask.java        | 23 ++++++++++----------
 1 file changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/b5d568d7/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
index 71f689a..0df3c4e 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java
@@ -123,6 +123,18 @@ public class SCPDataStageTask implements Task {
                 return status;
             }
 
+            StorageResourceDescription storageResource = taskContext.getParentProcessContext().getStorageResource();
+            StoragePreference storagePreference = taskContext.getParentProcessContext().getStoragePreference();
+
+            if (storageResource != null){
+                hostName = storageResource.getHostName();
+            }
+
+            if (storagePreference != null){
+                userName = storagePreference.getLoginUserName();
+                inputPath = storagePreference.getFileSystemRootLocation();
+            }
+
             // use rsync instead of scp if source and destination host and user name is same.
             URI sourceURI = new URI(subTaskModel.getSource());
             String fileName = sourceURI.getPath().substring(sourceURI.getPath().lastIndexOf(File.separator) + 1,
@@ -145,17 +157,6 @@ public class SCPDataStageTask implements Task {
 
             authenticationInfo = Factory.getStorageSSHKeyAuthentication(taskContext.getParentProcessContext());
             status = new TaskStatus(TaskState.COMPLETED);
-            StorageResourceDescription storageResource = taskContext.getParentProcessContext().getStorageResource();
-            StoragePreference storagePreference = taskContext.getParentProcessContext().getStoragePreference();
-
-            if (storageResource != null){
-                hostName = storageResource.getHostName();
-            }
-
-            if (storagePreference != null){
-                userName = storagePreference.getLoginUserName();
-                inputPath = storagePreference.getFileSystemRootLocation();
-            }
 
             ServerInfo serverInfo = new ServerInfo(userName, hostName, DEFAULT_SSH_PORT);
             Session sshSession = Factory.getSSHSession(authenticationInfo, serverInfo);