airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [3/8] airavata git commit: AIRAVATA-2500 Fix bug deriving ssh hostname
Date Mon, 25 Sep 2017 21:10:43 GMT
AIRAVATA-2500 Fix bug deriving ssh hostname


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

Branch: refs/heads/AIRAVATA-2500
Commit: 596eb5ba21bec45cdd5eb92a7b09f0249eddcceb
Parents: 8f68bc1
Author: Marcus Christie <machristie@apache.org>
Authored: Mon Sep 25 09:24:41 2017 -0400
Committer: Marcus Christie <machristie@apache.org>
Committed: Mon Sep 25 09:42:24 2017 -0400

----------------------------------------------------------------------
 .../airavata/accountprovisioning/SSHAccountManager.java     | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/596eb5ba/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
----------------------------------------------------------------------
diff --git a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
index 61deb49..e7e9052 100644
--- a/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
+++ b/modules/compute-account-provisioning/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
@@ -183,6 +183,15 @@ public class SSHAccountManager {
         return userComputeResourcePreference;
     }
 
+    private static String getSSHHostname(ComputeResourceDescription computeResourceDescription,
SSHJobSubmission sshJobSubmission) {
+        String alternativeSSHHostName = sshJobSubmission.getAlternativeSSHHostName();
+        if (alternativeSSHHostName != null && !"".equals(alternativeSSHHostName.trim()))
{
+            return alternativeSSHHostName;
+        } else {
+            return computeResourceDescription.getHostName();
+        }
+    }
+
     private static SSHAccountProvisioner createSshAccountProvisioner(String gatewayId, ComputeResourcePreference
computeResourcePreference) throws InvalidSetupException {
         String provisionerName = computeResourcePreference.getSshAccountProvisioner();
         Map<ConfigParam,String> provisionerConfig = convertConfigParams(provisionerName,
computeResourcePreference.getSshAccountProvisionerConfig());


Mime
View raw message