Skip to content

Commit

Permalink
FIXED JENKINS-19943 but credit should go to Nathan Kinder
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Brejner committed Jan 31, 2014
1 parent 210e69a commit b469410
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/hudson/plugins/ec2/ssh/EC2UnixLauncher.java
Expand Up @@ -220,10 +220,9 @@ private Connection connectToSsh(EC2Computer computer, PrintStream logger) throws
if (computer.getNode().usePrivateDnsName) {
host = instance.getPrivateDnsName();
} else {
/* VPC hosts don't have public DNS names, so we need to use an IP address instead */
if (vpc_id == null || vpc_id.equals("")) {
host = instance.getPublicDnsName();
} else {
host = instance.getPublicDnsName();
// If we fail to get a public DNS name, use the private IP.
if (host == null || host.equals("")) {
host = instance.getPrivateIpAddress();
}
}
Expand Down

0 comments on commit b469410

Please sign in to comment.