airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramin...@apache.org
Subject git commit: Fix AIRAVATA-1465 and NPE.
Date Sat, 11 Oct 2014 14:32:19 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 7781079dd -> 2fa6af64b


Fix AIRAVATA-1465 and NPE.

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

Branch: refs/heads/master
Commit: 2fa6af64b1846257e27289e60a982dfda6facecf
Parents: 7781079
Author: raminder <raminder@apache.org>
Authored: Sat Oct 11 10:31:35 2014 -0400
Committer: raminder <raminder@apache.org>
Committed: Sat Oct 11 10:31:35 2014 -0400

----------------------------------------------------------------------
 .../airavata/gfac/gsissh/util/GFACGSISSHUtils.java | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/2fa6af64/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
index d45bb9a..4d338e3 100644
--- a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
+++ b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
@@ -20,6 +20,7 @@
 */
 package org.apache.airavata.gfac.gsissh.util;
 
+import java.sql.SQLException;
 import java.util.*;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
@@ -57,6 +58,7 @@ import org.apache.airavata.schemas.gfac.SSHHostType;
 import org.apache.airavata.schemas.gfac.StringArrayType;
 import org.apache.airavata.schemas.gfac.URIArrayType;
 import org.apache.airavata.schemas.gfac.UnicoreHostType;
+import org.apache.openjpa.lib.log.Log;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -84,11 +86,16 @@ public class GFACGSISSHUtils {
             GSISecurityContext context = null;
             try {
                 TokenizedMyProxyAuthInfo tokenizedMyProxyAuthInfo = new TokenizedMyProxyAuthInfo(requestData);
-//                CredentialReader credentialReader = GFacUtils.getCredentialReader();
-//                if(credentialReader != null){
-//                	CertificateCredential credential = (CertificateCredential)credentialReader.getCredential(ServerSettings.getDefaultUserGateway(),
credentialStoreToken);
-//                		requestData.setMyProxyUserName(credential.getCommunityUser().getUserName());
-//                }
+                CredentialReader credentialReader = GFacUtils.getCredentialReader();
+                if(credentialReader != null){
+                	CertificateCredential credential = null;
+					try {
+						credential = (CertificateCredential)credentialReader.getCredential(ServerSettings.getDefaultUserGateway(),
credentialStoreToken);
+			      		requestData.setMyProxyUserName(credential.getCommunityUser().getUserName());
+					} catch (Exception e) {
+						logger.error(e.getLocalizedMessage());
+					}
+                }
 
                 GsisshHostType gsisshHostType = (GsisshHostType) registeredHost.getType();
                 String key = requestData.getMyProxyUserName() + registeredHost.getType().getHostAddress()
+


Mime
View raw message