builder/openstack: support ssh_interface [GH-2087]

This commit is contained in:
Mitchell Hashimoto 2015-06-12 14:22:32 -04:00
parent 35b8df1816
commit 31abc93f50
1 changed files with 9 additions and 1 deletions

View File

@ -33,7 +33,15 @@ func SSHAddress(
// Get all the addresses associated with this server. This
// was taken directly from Terraform.
for _, networkAddresses := range s.Addresses {
for pool, networkAddresses := range s.Addresses {
// If we have an SSH interface specified, skip it if no match
if sshinterface != "" && pool != sshinterface {
log.Printf(
"[INFO] Skipping pool %s, doesn't match requested %s",
pool, sshinterface)
continue
}
elements, ok := networkAddresses.([]interface{})
if !ok {
log.Printf(