Commit 5cd6e194 authored by Chris Bednarski's avatar Chris Bednarski

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

Fix handling IPv6 when ssh_interface set (openstack builder)
parents f8cfd0a1 8495a8c9
...@@ -105,11 +105,15 @@ func sshAddrFromPool(s *servers.Server, desired string) string { ...@@ -105,11 +105,15 @@ func sshAddrFromPool(s *servers.Server, desired string) string {
if address["OS-EXT-IPS:type"] == "floating" { if address["OS-EXT-IPS:type"] == "floating" {
addr = address["addr"].(string) addr = address["addr"].(string)
} else { } else {
if address["version"].(float64) == 4 { if address["version"].(float64) == 6 {
addr = fmt.Sprintf("[%s]", address["addr"].(string))
} else {
addr = address["addr"].(string) addr = address["addr"].(string)
} }
} }
if addr != "" { if addr != "" {
log.Printf("[DEBUG] Detected address: %s", addr)
return addr return addr
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment