airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [1/3] airavata git commit: LSF job id parsing checks if there is job id before parsing
Date Tue, 09 May 2017 17:12:51 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop 44f9493e6 -> a1c3e83eb


LSF job id parsing checks if there is job id before parsing


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

Branch: refs/heads/develop
Commit: 9ef08205c1f030b9252177c2076b310a16f1764c
Parents: 31a6705
Author: Marcus Christie <machristie@apache.org>
Authored: Tue May 9 12:39:59 2017 -0400
Committer: Marcus Christie <machristie@apache.org>
Committed: Tue May 9 12:39:59 2017 -0400

----------------------------------------------------------------------
 .../org/apache/airavata/gfac/core/cluster/OutputParser.java    | 2 +-
 .../org/apache/airavata/gfac/impl/job/LSFOutputParser.java     | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/9ef08205/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/OutputParser.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/OutputParser.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/OutputParser.java
index abe1805..59cf94d 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/OutputParser.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cluster/OutputParser.java
@@ -30,7 +30,7 @@ public interface OutputParser {
     /**
      * This can be used to parseSingleJob the result of a job submission to get the JobID
      * @param rawOutput
-     * @return
+     * @return the job id as a String, or null if no job id found
      */
     public String parseJobSubmission(String rawOutput)throws GFacException;
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/9ef08205/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/LSFOutputParser.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/LSFOutputParser.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/LSFOutputParser.java
index 0a82091..aab20b8 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/LSFOutputParser.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/LSFOutputParser.java
@@ -40,7 +40,11 @@ public class LSFOutputParser implements OutputParser {
     @Override
     public String parseJobSubmission(String rawOutput) throws GFacException {
         logger.debug(rawOutput);
-        return rawOutput.substring(rawOutput.indexOf("<")+1,rawOutput.indexOf(">"));
+        if (rawOutput.indexOf("<") >= 0) {
+            return rawOutput.substring(rawOutput.indexOf("<")+1,rawOutput.indexOf(">"));
+        } else {
+            return null;
+        }
     }
 
     @Override


Mime
View raw message