AIRAVATA-2500 SSHAccountManager bug fixes

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

Branch: refs/heads/AIRAVATA-2500
Commit: f139d5be0ec4be5935aad27c335e7c7c5d0e56e9
Parents: b6d15b5
Author: Marcus Christie <[email protected]>
Authored: Thu Sep 7 13:11:03 2017 -0400
Committer: Marcus Christie <[email protected]>
Committed: Thu Sep 7 13:11:03 2017 -0400

----------------------------------------------------------------------
 .../apache/airavata/accountprovisioning/SSHAccountManager.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/f139d5be/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 8493dc1..70c144c 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
@@ -165,7 +165,7 @@ public class SSHAccountManager {
                         PasswordCredential password = 
credentialStoreServiceClient.getPasswordCredential(configEntry.getValue(), 
gatewayId);
                         resolvedConfig.put(configEntry.getKey(), 
password.getPassword());
                     } catch (TException e) {
-                        throw new RuntimeException("Failed to get password 
needed to configure " + provisionerName);
+                        throw new RuntimeException("Failed to get password 
needed to configure " + provisionerName, e);
                     }
                 } else {
                     resolvedConfig.put(configEntry.getKey(), 
configEntry.getValue());
@@ -182,6 +182,8 @@ public class SSHAccountManager {
     }
 
     private static Map<ConfigParam, String> convertConfigParams(String 
provisionerName, Map<String, String> thriftConfigParams) {
+        // TODO: also check that all required parameters are present?
+        // TODO: also, this doesn't handle optional entries which should be 
skipped if missing from thriftConfigParams
         List<ConfigParam> configParams = 
SSHAccountProvisionerFactory.getSSHAccountProvisionerConfigParams(provisionerName);
         Map<String, ConfigParam> configParamMap = 
configParams.stream().collect(Collectors.toMap(ConfigParam::getName, 
Function.identity()));
 
@@ -204,7 +206,7 @@ public class SSHAccountManager {
         try {
             String credServerHost = 
ServerSettings.getCredentialStoreServerHost();
             int credServerPort = 
Integer.valueOf(ServerSettings.getCredentialStoreServerPort());
-            return CredentialStoreClientFactory.createAiravataCSClient(null, 
0);
+            return 
CredentialStoreClientFactory.createAiravataCSClient(credServerHost, 
credServerPort);
         } catch (CredentialStoreException | ApplicationSettingsException e) {
             throw new RuntimeException("Failed to create credential store 
service client", e);
         }

Reply via email to