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

Update jclouds to 1.9.0 to use ssh-agent feature #187

Merged
merged 4 commits into from
May 9, 2015
Merged
Show file tree
Hide file tree
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
13 changes: 9 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {

compile 'com.sun.jersey:jersey-core:1.11'
compile 'com.sun.jersey:jersey-servlet:1.11'
compile 'org.slf4j:slf4j-api:1.6.4'
compile 'org.slf4j:slf4j-api:1.7.2'
compile 'org.codehaus.jackson:jackson-core-asl:1.9.2'
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.2'
compile('com.netflix.eureka:eureka-client:1.1.22') {
Expand All @@ -35,8 +35,13 @@ dependencies {
compile 'commons-lang:commons-lang:2.6'
compile 'com.google.guava:guava:11.0.2'
compile 'org.apache.httpcomponents:httpclient:4.3'
compile 'org.jclouds.driver:jclouds-jsch:1.6.0'
compile 'org.jclouds.api:ec2:1.6.0'
compile 'com.google.auto.service:auto-service:1.0-rc2'
compile 'org.apache.jclouds.driver:jclouds-jsch:1.9.0'
compile 'org.apache.jclouds.driver:jclouds-slf4j:1.9.0'
compile 'org.apache.jclouds.api:ec2:1.9.0'
compile 'org.apache.jclouds.provider:aws-ec2:1.9.0'
compile 'ch.qos.logback:logback-classic:1.0.13'


testCompile 'org.testng:testng:6.3.1'
testCompile 'org.mockito:mockito-core:1.8.5'
Expand All @@ -51,7 +56,7 @@ test {
}

tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint" << "-Werror"
options.compilerArgs << "-Xlint"
}

artifacts {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip
2 changes: 1 addition & 1 deletion src/main/java/com/netflix/simianarmy/chaos/SshConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public SshConfig(MonkeyConfiguration config) {
}

if (privateKey == null) {
this.sshCredentials = null;
this.sshCredentials = LoginCredentials.builder().user(sshUser).build();
} else {
this.sshCredentials = LoginCredentials.builder().user(sshUser).privateKey(privateKey).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
import org.jclouds.compute.domain.NodeMetadata;
import org.jclouds.compute.domain.NodeMetadataBuilder;
import org.jclouds.domain.LoginCredentials;
import org.jclouds.ec2.EC2ApiMetadata;
import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;
import org.jclouds.ssh.SshClient;
import org.jclouds.ssh.jsch.config.JschSshClientModule;
Expand Down Expand Up @@ -725,7 +726,7 @@ public synchronized ComputeService getJcloudsComputeService() {
if (jcloudsComputeService == null) {
String username = awsCredentialsProvider.getCredentials().getAWSAccessKeyId();
String password = awsCredentialsProvider.getCredentials().getAWSSecretKey();
ComputeServiceContext jcloudsContext = ContextBuilder.newBuilder("ec2").credentials(username, password)
ComputeServiceContext jcloudsContext = ContextBuilder.newBuilder("aws-ec2").credentials(username, password)
.modules(ImmutableSet.<Module>of(new SLF4JLoggingModule(), new JschSshClientModule()))
.buildView(ComputeServiceContext.class);

Expand All @@ -750,7 +751,7 @@ public SshClient connectSsh(String instanceId, LoginCredentials credentials) {

node = NodeMetadataBuilder.fromNodeMetadata(node).credentials(credentials).build();

Utils utils = computeService.getContext().getUtils();
Utils utils = computeService.getContext().utils();
SshClient ssh = utils.sshForNode().apply(node);

ssh.connect();
Expand Down