Skip to content

Commit

Permalink
Merge pull request jenkinsci#3 from fbelzunc/JENKINS-35220
Browse files Browse the repository at this point in the history
[FIXED JENKINS-35220] Correctly display the credentials
  • Loading branch information
ndeloof committed May 30, 2016
2 parents 252cd85 + d59cbec commit 2b6a8ed
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,19 @@ public String getCredentialsId() {
}

public AmazonWebServicesCredentials getCredentials() {
List<AmazonWebServicesCredentials> c = CredentialsProvider.lookupCredentials(
List<AmazonWebServicesCredentials> credentials = CredentialsProvider.lookupCredentials(
AmazonWebServicesCredentials.class, Jenkins.getInstance(), ACL.SYSTEM, Collections.EMPTY_LIST);
return c.isEmpty() ? null : c.get(0);

if (credentials.isEmpty()) {
return null;
}

for (AmazonWebServicesCredentials awsCredentials : credentials) {
if (awsCredentials.getId().equals(this.credentialsId)) {
return awsCredentials;
}
}
return null;
}

public String getDescription() {
Expand Down

0 comments on commit 2b6a8ed

Please sign in to comment.