You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2017/05/24 21:34:36 UTC
[26/61] [abbrv] airavata git commit: fixing bug in parentPath dir
fixing bug in parentPath dir
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/04abb1e4
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/04abb1e4
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/04abb1e4
Branch: refs/heads/master
Commit: 04abb1e45a0d902dd73394404fdb980817a4da9d
Parents: 0fcce56
Author: scnakandala <su...@gmail.com>
Authored: Wed May 3 16:57:37 2017 -0400
Committer: scnakandala <su...@gmail.com>
Committed: Wed May 3 16:57:37 2017 -0400
----------------------------------------------------------------------
.../gfac/impl/task/SCPDataStageTask.java | 28 ++++++++++++--------
1 file changed, 17 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/04abb1e4/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 9a42124..e7451c4 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
@@ -138,15 +138,6 @@ public class SCPDataStageTask implements Task {
ServerInfo serverInfo = processContext.getComputeResourceServerInfo();
Session sshSession = Factory.getSSHSession(authenticationInfo, serverInfo);
- //Wildcard for file name. Has to find the correct name.
- if(fileName.startsWith("*.")){
- String temp = taskContext.getParentProcessContext().getDataMovementRemoteCluster()
- .getFileNameFromExtension(fileName.substring(2), inputPath, sshSession);
- if(temp != null && temp != ""){
- fileName = temp;
- }
- }
-
URI destinationURI = null;
if (subTaskModel.getDestination().startsWith("dummy")) {
destinationURI = TaskUtils.getDestinationURI(taskContext, hostName, inputPath, fileName);
@@ -163,11 +154,26 @@ public class SCPDataStageTask implements Task {
return status;
}
-
status = new TaskStatus(TaskState.COMPLETED);
+ //Wildcard for file name. Has to find the correct name.
+ if(fileName.startsWith("*.")){
+ String destParentPath = (new File(destinationURI.getPath())).getParentFile().getPath();
+ String temp = taskContext.getParentProcessContext().getDataMovementRemoteCluster()
+ .getFileNameFromExtension(fileName.substring(2), destParentPath, sshSession);
+ if(temp != null && temp != ""){
+ fileName = temp;
+ }
+ if(destParentPath.endsWith(File.separator)){
+ destinationURI = new URI(destParentPath + fileName);
+ }else{
+ destinationURI = new URI(destParentPath + File.separator + fileName);
+ }
+
+ }
+
if (processState == ProcessState.INPUT_DATA_STAGING) {
- inputDataStaging(taskContext, sshSession, sourceURI, destinationURI);
+ inputDataStaging(taskContext, sshSession, sourceURI, destinationURI);
status.setReason("Successfully staged input data");
} else if (processState == ProcessState.OUTPUT_DATA_STAGING) {
makeDir(taskContext, destinationURI);