Support IPv6 access address for Openstack

We still prefer the IPv4 address, but if there is an IPv6 address and no IPv4 address, use IPv6.
This commit is contained in:
Justin Santa Barbara 2013-08-31 22:39:30 -07:00
parent d8b048662f
commit 27dd2aa30f
1 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,9 @@ func SSHAddress(csp gophercloud.CloudServersProvider, port int) func(multistep.S
if s.AccessIPv4 != "" {
return fmt.Sprintf("%s:%d", s.AccessIPv4, port), nil
}
if s.AccessIPv6 != "" {
return fmt.Sprintf("[%s]:%d", s.AccessIPv6, port), nil
}
serverState, err := csp.ServerById(s.Id)
if err != nil {