airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [1/2] airavata git commit: adding remote cluster when login name changes
Date Wed, 10 Feb 2016 19:07:37 GMT
Repository: airavata
Updated Branches:
  refs/heads/master caca2fe6d -> 685b3c208


adding remote cluster when login name changes


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

Branch: refs/heads/master
Commit: 45157184c5b01e1c9b53f75546dbe9ad2585ff52
Parents: b96cb16
Author: Chathuri Wimalasena <chathuri@apache.org>
Authored: Wed Feb 10 14:08:44 2016 -0500
Committer: Chathuri Wimalasena <chathuri@apache.org>
Committed: Wed Feb 10 14:08:44 2016 -0500

----------------------------------------------------------------------
 .../org/apache/airavata/gfac/impl/Factory.java  | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/45157184/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
index 4ab9c6a..0b70b0b 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
@@ -234,7 +234,15 @@ public abstract class Factory {
             AuthenticationInfo authentication = remoteCluster.getAuthentication();
             if (authentication instanceof SSHKeyAuthentication){
                 SSHKeyAuthentication sshKeyAuthentication = (SSHKeyAuthentication)authentication;
-                sshKeyAuthentication.setUserName(processContext.getComputeResourcePreference().getLoginUserName());
+                if (!sshKeyAuthentication.getUserName().equals(processContext.getComputeResourcePreference().getLoginUserName())){
+                    JobManagerConfiguration jobManagerConfiguration = getJobManagerConfiguration(processContext.getResourceJobManager());
+                    if (jobSubmissionProtocol == JobSubmissionProtocol.SSH ||
+                            jobSubmissionProtocol == JobSubmissionProtocol.SSH_FORK) {
+                        remoteCluster = new HPCRemoteCluster(processContext.getServerInfo(),
jobManagerConfiguration,
+                                processContext.getSshKeyAuthentication());
+                    }
+                }
+
             }
         }
 		return remoteCluster;
@@ -261,7 +269,15 @@ public abstract class Factory {
             AuthenticationInfo authentication = remoteCluster.getAuthentication();
             if (authentication instanceof SSHKeyAuthentication){
                 SSHKeyAuthentication sshKeyAuthentication = (SSHKeyAuthentication)authentication;
-                sshKeyAuthentication.setUserName(processContext.getComputeResourcePreference().getLoginUserName());
+                if (!sshKeyAuthentication.getUserName().equals(processContext.getComputeResourcePreference().getLoginUserName())){
+                    JobManagerConfiguration jobManagerConfiguration = getJobManagerConfiguration(processContext.getResourceJobManager());
+                    dataMovementProtocol = processContext.getDataMovementProtocol();
+                    if (dataMovementProtocol == DataMovementProtocol.SCP) {
+                        remoteCluster = new HPCRemoteCluster(processContext.getServerInfo(),
jobManagerConfiguration,
+                                processContext.getSshKeyAuthentication());
+                    }
+                }
+
             }
         }
         return remoteCluster;


Mime
View raw message