26 lines
497 B
Go
Raw Normal View History

2016-01-11 12:22:41 +01:00
package cloudstack
import (
"fmt"
"github.com/hashicorp/packer/helper/multistep"
2016-01-11 12:22:41 +01:00
)
func commHost(state multistep.StateBag) (string, error) {
2017-07-26 19:01:12 +02:00
ip, hasIP := state.Get("ipaddress").(string)
if !hasIP {
return "", fmt.Errorf("Failed to retrieve IP address")
}
return ip, nil
}
2016-01-11 12:22:41 +01:00
func commPort(state multistep.StateBag) (int, error) {
commPort, hasPort := state.Get("commPort").(int)
if !hasPort {
return 0, fmt.Errorf("Failed to retrieve communication port")
2016-01-11 12:22:41 +01:00
}
return commPort, nil
2016-01-11 12:22:41 +01:00
}