airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject airavata git commit: Fix nulpointer issue with starndard error and output absence
Date Thu, 13 Aug 2015 16:42:58 GMT
Repository: airavata
Updated Branches:
  refs/heads/airavata-0.15-release-branch c9f30a4d5 -> f12272de4


Fix nulpointer issue with starndard error and output absence


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

Branch: refs/heads/airavata-0.15-release-branch
Commit: f12272de458842d766684e9112170cdd16cadbdf
Parents: c9f30a4
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Thu Aug 13 12:42:50 2015 -0400
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Thu Aug 13 12:42:50 2015 -0400

----------------------------------------------------------------------
 .../gfac/ssh/handler/AdvancedSCPOutputHandler.java     | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/f12272de/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java
b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java
index 0a2aa8d..c3a6239 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/handler/AdvancedSCPOutputHandler.java
@@ -140,8 +140,7 @@ public class AdvancedSCPOutputHandler extends AbstractHandler {
                     + File.separator;
                 pbsCluster.makeDirectory(outputPath);
             }
-            pbsCluster.scpTo(outputPath, standardError);
-            pbsCluster.scpTo(outputPath, standardOutput);
+            boolean stdoutPresent = false , stderrorPresent = false;
             List<OutputDataObjectType> outputArray = new ArrayList<OutputDataObjectType>();
             Map<String, Object> output = jobExecutionContext.getOutMessageContext().getParameters();
             Set<String> keys = output.keySet();
@@ -169,6 +168,7 @@ public class AdvancedSCPOutputHandler extends AbstractHandler {
                     dataObjectType.setSearchQuery(outputDataObjectType.getSearchQuery());
                     outputArray.add(dataObjectType);
                 }else if (outputDataObjectType.getType() == DataType.STDOUT) {
+                    stdoutPresent = true;
                     pbsCluster.scpTo(outputPath, standardOutput);
                     String fileName = standardOutput.substring(standardOutput.lastIndexOf(File.separatorChar)+1,
standardOutput.length());
                     OutputDataObjectType dataObjectType = new OutputDataObjectType();
@@ -181,6 +181,7 @@ public class AdvancedSCPOutputHandler extends AbstractHandler {
                     dataObjectType.setSearchQuery(outputDataObjectType.getSearchQuery());
                     outputArray.add(dataObjectType);
                 }else if (outputDataObjectType.getType() == DataType.STDERR) {
+                    stderrorPresent = true;
                     pbsCluster.scpTo(outputPath, standardError);
                     String fileName = standardError.substring(standardError.lastIndexOf(File.separatorChar)+1,
standardError.length());
                     OutputDataObjectType dataObjectType = new OutputDataObjectType();
@@ -194,7 +195,13 @@ public class AdvancedSCPOutputHandler extends AbstractHandler {
                     outputArray.add(dataObjectType);
                 }
              }
-           registry.add(ChildDataType.EXPERIMENT_OUTPUT, outputArray, jobExecutionContext.getExperimentID());
+            if (!stdoutPresent) {
+                log.warn("Didn't copy Standard output to client as it is not defined");
+            }
+            if (!stderrorPresent) {
+                log.warn("Didn't copy Standard error to client as it is not defined");
+            }
+            registry.add(ChildDataType.EXPERIMENT_OUTPUT, outputArray, jobExecutionContext.getExperimentID());
         } catch (SSHApiException e) {
             try {
                 StringWriter errors = new StringWriter();


Mime
View raw message