Merge pull request #2451 from monsterzz/b-openstack-ipv6-ssh-support

Fix handling IPv6 when ssh_interface set (openstack builder)
This commit is contained in:
Chris Bednarski 2015-07-30 14:36:17 -07:00
commit 5cd6e19467
1 changed files with 5 additions and 1 deletions

View File

@ -105,11 +105,15 @@ func sshAddrFromPool(s *servers.Server, desired string) string {
if address["OS-EXT-IPS:type"] == "floating" {
addr = address["addr"].(string)
} else {
if address["version"].(float64) == 4 {
if address["version"].(float64) == 6 {
addr = fmt.Sprintf("[%s]", address["addr"].(string))
} else {
addr = address["addr"].(string)
}
}
if addr != "" {
log.Printf("[DEBUG] Detected address: %s", addr)
return addr
}
}