airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata] 02/07: AIRAVATA-2840 Skipping sharing users with bad userIds
Date Mon, 24 Sep 2018 16:55:39 GMT
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit 4658347a21fcea3d4b93d4400444308727f88225
Author: Marcus Christie <machristie@apache.org>
AuthorDate: Wed Sep 19 13:45:53 2018 -0400

    AIRAVATA-2840 Skipping sharing users with bad userIds
---
 .../sharing/registry/migrator/airavata/AiravataDataMigrator.java     | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java
b/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java
index de0f7e8..ee8f339 100644
--- a/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java
+++ b/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java
@@ -361,6 +361,11 @@ public class AiravataDataMigrator {
             for (User sharingUser : sharingUsers) {
 
                 String userId = sharingUser.getUserId();
+                int index = userId.lastIndexOf("@");
+                if (index <= 0) {
+                    System.out.println("Skipping credentials for user " + userId + " since
sharing user id is improperly formed");
+                    continue;
+                }
                 String username = userId.substring(0, userId.lastIndexOf("@"));
                 List<CredentialSummary> gatewayCredentialSummaries = credentialStoreServiceClient.getAllCredentialSummaryForUserInGateway(SummaryType.SSH,
domainID, username);
                 for (CredentialSummary credentialSummary : gatewayCredentialSummaries) {


Mime
View raw message