Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
JENKINS-19943 Fix connection to Windows slaves outside us-east-1.
  • Loading branch information
Steve committed Sep 15, 2014
1 parent 7fe8fdf commit 00cfb67
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/main/java/hudson/plugins/ec2/win/EC2WindowsLauncher.java
Expand Up @@ -95,16 +95,14 @@ private WinConnection connectToWinRM(EC2Computer computer, PrintStream logger) t
host = instance.getPrivateDnsName();
ip = instance.getPrivateIpAddress(); // SmbFile doesn't quite work with hostnames
} 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();
if (host == null || host.equals("")) {
host = instance.getPrivateDnsName();
ip = instance.getPrivateIpAddress(); // SmbFile doesn't quite work with hostnames
}
else {
host = instance.getPublicDnsName();
ip = instance.getPublicIpAddress(); // SmbFile doesn't quite work with hostnames
} else {
host = instance.getPrivateDnsName();
ip = instance.getPrivateIpAddress();
}
}

Expand Down

0 comments on commit 00cfb67

Please sign in to comment.