这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Mar 4, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/main/java/com/netflix/simianarmy/client/aws/AWSClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -856,15 +856,19 @@ public Instance describeInstance(String instanceId) {

/** {@inheritDoc} */
@Override
public synchronized ComputeService getJcloudsComputeService() {
public ComputeService getJcloudsComputeService() {
if (jcloudsComputeService == null) {
String username = awsCredentialsProvider.getCredentials().getAWSAccessKeyId();
String password = awsCredentialsProvider.getCredentials().getAWSSecretKey();
ComputeServiceContext jcloudsContext = ContextBuilder.newBuilder("aws-ec2").credentials(username, password)
.modules(ImmutableSet.<Module>of(new SLF4JLoggingModule(), new JschSshClientModule()))
.buildView(ComputeServiceContext.class);

this.jcloudsComputeService = jcloudsContext.getComputeService();
synchronized(this) {
if (jcloudsComputeService == null) {
String username = awsCredentialsProvider.getCredentials().getAWSAccessKeyId();
String password = awsCredentialsProvider.getCredentials().getAWSSecretKey();
ComputeServiceContext jcloudsContext = ContextBuilder.newBuilder("aws-ec2").credentials(username, password)
.modules(ImmutableSet.<Module>of(new SLF4JLoggingModule(), new JschSshClientModule()))
.buildView(ComputeServiceContext.class);

this.jcloudsComputeService = jcloudsContext.getComputeService();
}
}
}

return jcloudsComputeService;
Expand Down