packer/builder/cloudstack/ssh.go
2019-03-19 12:54:15 +01:00

25 lines
499 B
Go

package cloudstack
import (
"fmt"
"github.com/hashicorp/packer/helper/multistep"
)
func commHost(state multistep.StateBag) (string, error) {
ip, hasIP := state.Get("ipaddress").(string)
if !hasIP {
return "", fmt.Errorf("Failed to retrieve IP address")
}
return ip, nil
}
func commPort(state multistep.StateBag) (uint, error) {
commPort, hasPort := state.Get("commPort").(uint)
if !hasPort {
return 0, fmt.Errorf("Failed to retrieve communication port")
}
return commPort, nil
}