Repository: airavata Updated Branches: refs/heads/develop b96cb162e -> 45157184c
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/develop Commit: 45157184c5b01e1c9b53f75546dbe9ad2585ff52 Parents: b96cb16 Author: Chathuri Wimalasena <[email protected]> Authored: Wed Feb 10 14:08:44 2016 -0500 Committer: Chathuri Wimalasena <[email protected]> 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;
